From: Hugh Dickins Date: Tue, 26 Jul 2011 10:14:55 +0000 (+1000) Subject: Fix NULL dereference I introduced in mincore_page(). X-Git-Tag: next-20110802~1^2~14 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=b1cd1ebbe1bdc1bc4025949e3e8b0f76d99c953f;p=karo-tx-linux.git Fix NULL dereference I introduced in mincore_page(). Signed-off-by: Hugh Dickins Cc: Rik van Riel Signed-off-by: Andrew Morton --- diff --git a/mm/mincore.c b/mm/mincore.c index 8ad3e90711bd..733f1829b0dc 100644 --- a/mm/mincore.c +++ b/mm/mincore.c @@ -71,13 +71,13 @@ static unsigned char mincore_page(struct address_space *mapping, pgoff_t pgoff) * tmpfs's .fault). So swapped out tmpfs mappings are tested here. */ page = find_get_page(mapping, pgoff); - if (page) { #ifdef CONFIG_SWAP - if (radix_tree_exceptional_entry(page)) { - swp_entry_t swap = radix_to_swp_entry(page); - page = find_get_page(&swapper_space, swap.val); - } + if (radix_tree_exceptional_entry(page)) { + swp_entry_t swap = radix_to_swp_entry(page); + page = find_get_page(&swapper_space, swap.val); + } #endif + if (page) { present = PageUptodate(page); page_cache_release(page); }