projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ae83d0b
)
tee: remove unnecessary NULL check in tee_shm_alloc()
author
Dan Carpenter
<dan.carpenter@oracle.com>
Tue, 7 Apr 2020 09:30:28 +0000
(12:30 +0300)
committer
Jens Wiklander
<jens.wiklander@linaro.org>
Mon, 20 Apr 2020 11:12:01 +0000
(13:12 +0200)
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>
drivers/tee/tee_shm.c
patch
|
blob
|
history
diff --git
a/drivers/tee/tee_shm.c
b/drivers/tee/tee_shm.c
index bd679b72bd05ce7ce35061fac83f996feabead8f..8895cb910166e9c2d74a1ee73073b36501f0b1cc 100644
(file)
--- 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: