Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 196cb35a authored by Colin Ian King's avatar Colin Ian King Committed by Victor Chong
Browse files

BACKPORT: 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")

Change-Id: I9dbf1a729d784c1c13eabe0d70c48f1f12b2e5b3
Fixes: 033ddf12bcf5 ("tee: add register user memory")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Signed-off-by: default avatarJens Wiklander <jens.wiklander@linaro.org>
(cherry picked from commit c94f31b526fe658c25dd2d07c90486a85437f01c)
Signed-off-by: default avatarVictor Chong <victor.chong@linaro.org>
parent 6e76ed56
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment