Skip to content

Commit

Permalink
tee: optee: add missing mutext_destroy in optee_ffa_probe
Browse files Browse the repository at this point in the history
[ Upstream commit b5e2288 ]

The error handling code of optee_ffa_probe misses the mutex_destroy of
ffa.mutex when mutext_init succeeds.

Fix this by adding mutex_destory of ffa.mutex at the error handling part

Fixes: aceeafe ("optee: use driver internal tee_context for some rpc")
Signed-off-by: Dongliang Mu <mudongliangabcd@gmail.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
mudongliang authored and gregkh committed May 9, 2022
1 parent 1e90d37 commit 7102dd0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/tee/optee/ffa_abi.c
Expand Up @@ -894,6 +894,7 @@ static int optee_ffa_probe(struct ffa_device *ffa_dev)
rhashtable_free_and_destroy(&optee->ffa.global_ids, rh_free_fn, NULL);
optee_supp_uninit(&optee->supp);
mutex_destroy(&optee->call_queue.mutex);
mutex_destroy(&optee->ffa.mutex);
err_unreg_supp_teedev:
tee_device_unregister(optee->supp_teedev);
err_unreg_teedev:
Expand Down

0 comments on commit 7102dd0

Please sign in to comment.