linux/drivers/tee
Colin Ian King c94f31b526 tee: shm: don't put_page on null shm->pages
In the case that shm->pages fails to allocate, the current exit
error path will try to put_page on a null shm->pages and cause
a null pointer dereference when accessing shm->pages[n]. Fix this
by only performing the put_page and kfree on shm->pages if it
is not null.

Detected by CoverityScan, CID#1463283 ("Dereference after null check")

Fixes: 033ddf12bc ("tee: add register user memory")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
2017-12-28 22:20:10 +01:00
..
optee tee: optee: check type of registered shared memory 2017-12-28 13:21:27 +01:00
Kconfig
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
tee_core.c tee: use reference counting for tee_context 2017-12-15 13:36:18 +01:00
tee_private.h tee: use reference counting for tee_context 2017-12-15 13:36:18 +01:00
tee_shm.c tee: shm: don't put_page on null shm->pages 2017-12-28 22:20:10 +01:00
tee_shm_pool.c tee: flexible shared memory pool creation 2017-12-15 12:37:29 +01:00