diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2020-04-07 11:30:28 +0200 |
---|---|---|
committer | Jens Wiklander <jens.wiklander@linaro.org> | 2020-04-20 13:12:01 +0200 |
commit | 1115899e7aad71bc36100c3fa1d0b99cff9263e6 (patch) | |
tree | 2f1021baa0381ce6ecbd76d7f9fd2721095bf3ec /drivers/tee | |
parent | Linux 5.7-rc2 (diff) | |
download | linux-1115899e7aad71bc36100c3fa1d0b99cff9263e6.tar.xz linux-1115899e7aad71bc36100c3fa1d0b99cff9263e6.zip |
tee: remove unnecessary NULL check in tee_shm_alloc()
Smatch complains that "ctx" isn't checked consistently:
drivers/tee/tee_shm.c:164 tee_shm_alloc()
warn: variable dereferenced before check 'ctx' (see line 95)
I audited the callers and "ctx" can't be NULL so the check can be
removed.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Diffstat (limited to 'drivers/tee')
-rw-r--r-- | drivers/tee/tee_shm.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/tee/tee_shm.c b/drivers/tee/tee_shm.c index bd679b72bd05..8895cb910166 100644 --- a/drivers/tee/tee_shm.c +++ b/drivers/tee/tee_shm.c @@ -161,8 +161,7 @@ struct tee_shm *tee_shm_alloc(struct tee_context *ctx, size_t size, u32 flags) } } - if (ctx) - teedev_ctx_get(ctx); + teedev_ctx_get(ctx); return shm; err_rem: |