Skip to content

Commit 62ade1b

Browse files
YueHaibingarndb
authored andcommitted
tee: optee: Fix unsigned comparison with less than zero
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: c3fa24a ("tee: optee: add TEE bus device enumeration support") Signed-off-by: YueHaibing <yuehaibing@huawei.com> Reviewed-by: Sumit Garg <sumit.garg@linaro.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
1 parent 8deed84 commit 62ade1b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/tee/optee/device.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ static int optee_ctx_match(struct tee_ioctl_version_data *ver, const void *data)
3434
static int get_devices(struct tee_context *ctx, u32 session,
3535
struct tee_shm *device_shm, u32 *shm_size)
3636
{
37-
u32 ret = 0;
37+
int ret = 0;
3838
struct tee_ioctl_invoke_arg inv_arg;
3939
struct tee_param param[4];
4040

0 commit comments

Comments
 (0)