Re: [PATCH] tee: shm: don't put_page on null shm->pages

2017-12-28 Thread Jens Wiklander
On Fri, Dec 22, 2017 at 6:51 PM, Colin King wrote: > From: Colin Ian King > > 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 t

[PATCH] tee: shm: don't put_page on null shm->pages

2017-12-22 Thread Colin King
From: Colin Ian King 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. Detecte