]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
optee: Fix memory leak when failing to register shm pages
authorTyler Hicks <tyhicks@linux.microsoft.com>
Mon, 14 Jun 2021 22:33:10 +0000 (17:33 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Aug 2021 11:21:01 +0000 (13:21 +0200)
commit3c712f14d8a9354a8807c15c64c8dd334499cc42
tree7961fd9b14ac78d0e02d100824394f0829c60faf
parent0572199b78b39d09757688217245fb933d2e4752
optee: Fix memory leak when failing to register shm pages

commit ec185dd3ab257dc2a60953fdf1b6622f524cc5b7 upstream.

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

Fixes: a249dd200d03 ("tee: optee: Fix dynamic shm pool allocations")
Fixes: 5a769f6ff439 ("optee: Fix multi page dynamic shm pool alloc")
Cc: stable@vger.kernel.org
Signed-off-by: Tyler Hicks <tyhicks@linux.microsoft.com>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tee/optee/shm_pool.c