]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Fix NULL dereference I introduced in mincore_page().
authorHugh Dickins <hughd@google.com>
Tue, 26 Jul 2011 10:14:55 +0000 (20:14 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 1 Aug 2011 03:36:38 +0000 (13:36 +1000)
Signed-off-by: Hugh Dickins <hughd@google.com>
Cc: Rik van Riel <riel@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/mincore.c

index 8ad3e90711bdd7153fa9e0a4d180f677b38b502a..733f1829b0dc476136d787744bd9704d4812b1a3 100644 (file)
@@ -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);
        }