Skip to content
Commit 0e8f989a authored by David Howells's avatar David Howells
Browse files

NOMMU: Fix cleanup handling in ramfs_nommu_get_umapped_area()



Fix cleanup handling in ramfs_nommu_get_umapped_area() by only freeing the
number of pages that find_get_pages() said it had returned (nr) rather than
attempting to free the number of pages we asked for (lpages) - thus avoiding
the situation whereby put_page() may be handed NULL pointers if
find_get_pages() returned fewer pages that were requested.

Also avoid a warning about nr being uninitialised and the need for an
if-statement in the cleanup path by using appropriate gotos.

Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
parent 9e42d0cf
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment