]> git.baikalelectronics.ru Git - kernel.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)
commit4bbe290201ae01d9c9a8e52812bc378cdd978824
tree7961fd9b14ac78d0e02d100824394f0829c60faf
parent409f25ed49ab3fa6fe82a04d625265de13378eab
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