]> git.itanic.dy.fi Git - linux-stable/commit
optee: fix tee out of memory failure seen during kexec reboot
authorAllen Pais <apais@linux.microsoft.com>
Mon, 14 Jun 2021 22:33:12 +0000 (17:33 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Aug 2021 11:22:13 +0000 (13:22 +0200)
commit2a879ff9719fdb75bdedfca029a381105aea6d72
treeb69694f17755380d200b8c7e8f27a02862eb2e9e
parentad80c25987feb8930e573ff405ea16e391134971
optee: fix tee out of memory failure seen during kexec reboot

commit f25889f93184db8b07a543cc2bbbb9a8fcaf4333 upstream.

The following out of memory errors are seen on kexec reboot
from the optee core.

[    0.368428] tee_bnxt_fw optee-clnt0: tee_shm_alloc failed
[    0.368461] tee_bnxt_fw: probe of optee-clnt0 failed with error -22

tee_shm_release() is not invoked on dma shm buffer.

Implement .shutdown() method to handle the release of the buffers
correctly.

More info:
https://github.com/OP-TEE/optee_os/issues/3637

Cc: stable@vger.kernel.org
Signed-off-by: Allen Pais <apais@linux.microsoft.com>
Reviewed-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/core.c