Re: [PATCH v4 1/8] optee: Fix memory leak when failing to register shm pages

From: Jens Wiklander
Date: Fri Jun 11 2021 - 05:05:35 EST


On Thu, Jun 10, 2021 at 11:09 PM Tyler Hicks
<tyhicks@xxxxxxxxxxxxxxxxxxx> wrote:
>
> 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")
> Signed-off-by: Tyler Hicks <tyhicks@xxxxxxxxxxxxxxxxxxx>
> ---
> drivers/tee/optee/shm_pool.c | 12 ++++++++++--
> 1 file changed, 10 insertions(+), 2 deletions(-)

Looks good.

Reviewed-by: Jens Wiklander <jens.wiklander@xxxxxxxxxx>