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: c3fa24af9244 ("tee: optee: add TEE bus device enumeration support")
Signed-off-by: YueHaibing <[email protected]>
Reviewed-by: Sumit Garg <[email protected]>
Signed-off-by: Arnd Bergmann <[email protected]>
static int get_devices(struct tee_context *ctx, u32 session,
struct tee_shm *device_shm, u32 *shm_size)
{
- u32 ret = 0;
+ int ret = 0;
struct tee_ioctl_invoke_arg inv_arg;
struct tee_param param[4];