Skip to content

Commit 40eb0dc

Browse files
Yang Yingliangjenswi-linaro
authored andcommitted
tee: optee: fix error return code in probe function
If teedev_open() fails, probe function need return error code. Fixes: aceeafe ("optee: use driver internal tee_context for some rpc") Reported-by: Hulk Robot <[email protected]> Signed-off-by: Yang Yingliang <[email protected]> Signed-off-by: Jens Wiklander <[email protected]>
1 parent aceeafe commit 40eb0dc

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

drivers/tee/optee/ffa_abi.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,8 +860,10 @@ static int optee_ffa_probe(struct ffa_device *ffa_dev)
860860
optee_supp_init(&optee->supp);
861861
ffa_dev_set_drvdata(ffa_dev, optee);
862862
ctx = teedev_open(optee->teedev);
863-
if (IS_ERR(ctx))
863+
if (IS_ERR(ctx)) {
864+
rc = PTR_ERR(ctx);
864865
goto err_rhashtable_free;
866+
}
865867
optee->ctx = ctx;
866868
rc = optee_notif_init(optee, OPTEE_DEFAULT_MAX_NOTIF_VALUE);
867869
if (rc)

drivers/tee/optee/smc_abi.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1427,8 +1427,10 @@ static int optee_probe(struct platform_device *pdev)
14271427

14281428
platform_set_drvdata(pdev, optee);
14291429
ctx = teedev_open(optee->teedev);
1430-
if (IS_ERR(ctx))
1430+
if (IS_ERR(ctx)) {
1431+
rc = PTR_ERR(ctx);
14311432
goto err_supp_uninit;
1433+
}
14321434
optee->ctx = ctx;
14331435
rc = optee_notif_init(optee, max_notif_value);
14341436
if (rc)

0 commit comments

Comments
 (0)