Commit 41d3bf10 authored by Tyler Hicks's avatar Tyler Hicks Committed by Zheng Zengkai
Browse files

optee: Fix memory leak when failing to register shm pages

stable inclusion
from stable-5.10.58
commit 1340dc3fb75ea69221f4f5dcb0cbace55ad0331c
bugzilla: 176984 https://gitee.com/openeuler/kernel/issues/I4E2P4

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=1340dc3fb75ea69221f4f5dcb0cbace55ad0331c



--------------------------------

commit ec185dd3 upstream.

Free the previously allocated pages when we encounter an error condition
while attempting to register the pages with the secure world.

Fixes: a249dd20 ("tee: optee: Fix dynamic shm pool allocations")
Fixes: 5a769f6f ("optee: Fix multi page dynamic shm pool alloc")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarTyler Hicks <tyhicks@linux.microsoft.com>
Reviewed-by: default avatarJens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: default avatarSumit Garg <sumit.garg@linaro.org>
Signed-off-by: default avatarJens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarChen Jun <chenjun102@huawei.com>
Acked-by: default avatarWeilong Chen <chenweilong@huawei.com>
Signed-off-by: default avatarChen Jun <chenjun102@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent c347441c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment