android_kernel_xiaomi_sm8450/drivers/tee/optee
Yang Yingliang b547bf71fa tee: optee: fix possible memory leak in optee_register_device()
[ Upstream commit cce616e012c215d65c15e5d1afa73182dea49389 ]

If device_register() returns error in optee_register_device(),
the name allocated by dev_set_name() need be freed. As comment
of device_register() says, it should use put_device() to give
up the reference in the error path. So fix this by calling
put_device(), then the name can be freed in kobject_cleanup(),
and optee_device is freed in optee_release_device().

Fixes: c3fa24af92 ("tee: optee: add TEE bus device enumeration support")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
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>
2022-12-02 17:39:59 +01:00
..
call.c tee: Correct inappropriate usage of TEE_SHM_DMA_BUF flag 2021-08-15 14:00:24 +02:00
core.c optee: use driver internal tee_context for some rpc 2022-03-02 11:42:47 +01:00
device.c tee: optee: fix possible memory leak in optee_register_device() 2022-12-02 17:39:59 +01:00
Kconfig tee: optee: Fix compilation issue with nommu 2020-01-23 10:55:20 +01:00
Makefile tee: optee: add TEE bus device enumeration support 2019-02-01 15:12:46 +01:00
optee_msg.h optee: use export_uuid() to copy client UUID 2021-06-10 13:39:21 +02:00
optee_private.h optee: use driver internal tee_context for some rpc 2022-03-02 11:42:47 +01:00
optee_smc.h driver: tee: Handle NULL pointer indication from client 2020-08-21 08:55:13 +02:00
rpc.c optee: use driver internal tee_context for some rpc 2022-03-02 11:42:47 +01:00
shm_pool.c tee: optee: Fix incorrect page free bug 2021-12-29 12:26:05 +01:00
shm_pool.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 282 2019-06-05 17:36:37 +02:00
supp.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 282 2019-06-05 17:36:37 +02:00