Skip to content

Commit 1115899

Browse files
Dan Carpenterjenswi-linaro
authored andcommitted
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 <[email protected]> Signed-off-by: Jens Wiklander <[email protected]>
1 parent ae83d0b commit 1115899

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/tee/tee_shm.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,7 @@ struct tee_shm *tee_shm_alloc(struct tee_context *ctx, size_t size, u32 flags)
161161
}
162162
}
163163

164-
if (ctx)
165-
teedev_ctx_get(ctx);
164+
teedev_ctx_get(ctx);
166165

167166
return shm;
168167
err_rem:

0 commit comments

Comments
 (0)