The return from the call to tee_client_invoke_func can be a
negative error code however this is being assigned to an
unsigned variable 'ret' hence the check is always false.
Fix this by making 'ret' an int.
Detected by Coccinelle ("Unsigned expression compared with zero:
ret < 0")
Fixes: 5fe8b1cc6a03 ("hwrng: add OP-TEE based rng driver")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
static size_t get_optee_rng_data(struct optee_rng_private *pvt_data,
void *buf, size_t req_size)
{
static size_t get_optee_rng_data(struct optee_rng_private *pvt_data,
void *buf, size_t req_size)
{
u8 *rng_data = NULL;
size_t rng_size = 0;
struct tee_ioctl_invoke_arg inv_arg;
u8 *rng_data = NULL;
size_t rng_size = 0;
struct tee_ioctl_invoke_arg inv_arg;
static int get_optee_rng_info(struct device *dev)
{
static int get_optee_rng_info(struct device *dev)
{
struct tee_ioctl_invoke_arg inv_arg;
struct tee_param param[4];
struct tee_ioctl_invoke_arg inv_arg;
struct tee_param param[4];