Commit b30a9b0
tee: optee: fix device enumeration error handling
[ Upstream commit 03212e3 ]
Prior to this patch in optee_probe() when optee_enumerate_devices() was
called the struct optee was fully initialized. If
optee_enumerate_devices() returns an error optee_probe() is supposed to
clean up and free the struct optee completely, but will at this late
stage need to call optee_remove() instead. This isn't done and thus
freeing the struct optee prematurely.
With this patch the call to optee_enumerate_devices() is done after
optee_probe() has returned successfully and in case
optee_enumerate_devices() fails everything is cleaned up with a call to
optee_remove().
Fixes: c3fa24a ("tee: optee: add TEE bus device enumeration support")
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>1 parent 5c179c0 commit b30a9b0
1 file changed
Lines changed: 12 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
643 | 643 | | |
644 | 644 | | |
645 | 645 | | |
646 | | - | |
647 | | - | |
648 | | - | |
649 | | - | |
650 | | - | |
651 | 646 | | |
652 | 647 | | |
653 | 648 | | |
| |||
702 | 697 | | |
703 | 698 | | |
704 | 699 | | |
705 | | - | |
706 | | - | |
707 | | - | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
708 | 704 | | |
709 | 705 | | |
710 | 706 | | |
| |||
723 | 719 | | |
724 | 720 | | |
725 | 721 | | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
726 | 730 | | |
727 | 731 | | |
728 | 732 | | |
| |||
0 commit comments