tee: optee: fix error return code in probe function
Subsystems (2)
PATCH 1/1 tee: optee: fix error return code in probe function
If teedev_open() fails, probe function need return error code.
Fixes aceeafefff73 ("optee: use driver internal tee_context for some rpc")
Reported-by Hulk Robot <[email protected]>
Signed-off-by Yang Yingliang <[email protected]>
--- drivers/tee/optee/ffa_abi.c | 4 +++- drivers/tee/optee/smc_abi.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-)
drivers/tee/optee/ffa_abi.c +3 -1
@@ -869,8 +869,10 @@ static int optee_ffa_probe(struct ffa_device *ffa_dev)optee_supp_init (&optee->supp);ffa_dev_set_drvdata (ffa_dev, optee); ctx =teedev_open (optee->teedev); -if (IS_ERR (ctx)) +if (IS_ERR (ctx)) { + rc =PTR_ERR (ctx); goto err_rhashtable_free; + } optee->ctx = ctx; rc =optee_notif_init (optee,OPTEE_DEFAULT_MAX_NOTIF_VALUE );if (rc)
drivers/tee/optee/smc_abi.c +3 -1
@@ -1417,8 +1417,10 @@ static int optee_probe(struct platform_device *pdev)platform_set_drvdata (pdev, optee); ctx =teedev_open (optee->teedev); -if (IS_ERR (ctx)) +if (IS_ERR (ctx)) { + rc =PTR_ERR (ctx); goto err_supp_uninit; + } optee->ctx = ctx; rc =optee_notif_init (optee, max_notif_value);if (rc)
Signature · 1 line
2.25.1
Quoted 11 lines · Yang Yingliang
If
teedev_open()fails, probe function need return error code.Fixes aceeafefff73 ("optee: use driver internal tee_context for some rpc")Reported-by Hulk Robot <[email protected]>Signed-off-by Yang Yingliang <[email protected]>--- drivers/tee/optee/ffa_abi.c | 4 +++- drivers/tee/optee/smc_abi.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-)
Well spotted, I'm picking up this.
Thanks,
Jens
Quoted 36 lines
drivers/tee/optee/ffa_abi.c +3
-1@@ -869,8 +869,10 @@ static int optee_ffa_probe(struct ffa_device *ffa_dev)optee_supp_init (&optee->supp);ffa_dev_set_drvdata (ffa_dev, optee); ctx =teedev_open (optee->teedev); -if (IS_ERR (ctx)) +if (IS_ERR (ctx)) { + rc =PTR_ERR (ctx); goto err_rhashtable_free; + } optee->ctx = ctx; rc =optee_notif_init (optee,OPTEE_DEFAULT_MAX_NOTIF_VALUE );if (rc)drivers/tee/optee/smc_abi.c +3
-2@@ -1417,8 +1417,10 @@ static int optee_probe(struct platform_device *pdev)platform_set_drvdata (pdev, optee); ctx =teedev_open (optee->teedev); -if (IS_ERR (ctx)) +if (IS_ERR (ctx)) { + rc =PTR_ERR (ctx); goto err_supp_uninit; + } optee->ctx = ctx; rc =optee_notif_init (optee, max_notif_value);if (rc) --2.25.1