summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2021-11-22 11:32:15 +0100
committerArnd Bergmann <arnd@arndb.de>2021-11-22 11:32:16 +0100
commitd063f30765fef6bca08e0caecb41ca3d6b96dc78 (patch)
treed590b8cf7499f3fa60419dbe6774111204d32b7c
parent3449d6bf4c4581f7c11a2a2ff60cb53160906474 (diff)
parentc23ca66a4dadb6f050dc57358bc8d57a747c35bf (diff)
Merge tag 'optee-fix-for-v5.16' of git://git.linaro.org/people/jens.wiklander/linux-tee into arm/fixes
Fix possible NULL pointer dereference in OP-TEE driver * tag 'optee-fix-for-v5.16' of git://git.linaro.org/people/jens.wiklander/linux-tee: optee: fix kfree NULL pointer Link: https://lore.kernel.org/r/20211117125747.GA2896197@jade Signed-off-by: Arnd Bergmann <arnd@arndb.de>
-rw-r--r--drivers/tee/optee/ffa_abi.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/tee/optee/ffa_abi.c b/drivers/tee/optee/ffa_abi.c
index 45424824e0f9..d8c8683863aa 100644
--- a/drivers/tee/optee/ffa_abi.c
+++ b/drivers/tee/optee/ffa_abi.c
@@ -810,10 +810,9 @@ static int optee_ffa_probe(struct ffa_device *ffa_dev)
return -EINVAL;
optee = kzalloc(sizeof(*optee), GFP_KERNEL);
- if (!optee) {
- rc = -ENOMEM;
- goto err;
- }
+ if (!optee)
+ return -ENOMEM;
+
optee->pool = optee_ffa_config_dyn_shm();
if (IS_ERR(optee->pool)) {
rc = PTR_ERR(optee->pool);