diff options
author | YueHaibing <yuehaibing@huawei.com> | 2019-02-19 15:04:28 +0800 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2019-02-20 17:57:47 +0100 |
commit | 62ade1bed27c26c2ea9280174ae6d6c7a9e825b2 (patch) | |
tree | 6c8d01c903e4f1d9307059a2a1613a98cc03564b /drivers/tee/optee | |
parent | 8deed847445a8fb619689988a24c0f8df1369a58 (diff) | |
download | linux-stable-62ade1bed27c26c2ea9280174ae6d6c7a9e825b2.tar.gz linux-stable-62ade1bed27c26c2ea9280174ae6d6c7a9e825b2.tar.bz2 linux-stable-62ade1bed27c26c2ea9280174ae6d6c7a9e825b2.zip |
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: c3fa24af9244 ("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>
Diffstat (limited to 'drivers/tee/optee')
-rw-r--r-- | drivers/tee/optee/device.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/tee/optee/device.c b/drivers/tee/optee/device.c index 167839b371f2..e3a148521ec1 100644 --- a/drivers/tee/optee/device.c +++ b/drivers/tee/optee/device.c @@ -34,7 +34,7 @@ static int optee_ctx_match(struct tee_ioctl_version_data *ver, const void *data) 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]; |