]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
logfs: check for the return value after calling find_or_create_page()
authorYounger Liu <liuyiyang@hisense.com>
Fri, 3 Jan 2014 03:10:06 +0000 (14:10 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 3 Jan 2014 03:10:06 +0000 (14:10 +1100)
In get_mapping_page(), after calling find_or_create_page(), the return
value should be checked.

 This patch has been provided:
http://www.spinics.net/lists/linux-fsdevel/msg66948.html but not been
applied now.

Signed-off-by: Younger Liu <liuyiyang@hisense.com>
Cc: Younger Liu <younger.liucn@gmail.com>
Cc: Vyacheslav Dubeyko <slava@dubeyko.com>
Reviewed-by: Prasad Joshi <prasadjoshi.linux@gmail.com>
Cc: Jörn Engel <joern@logfs.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/logfs/segment.c

index d448a777166b71bc21df131c0c32a462d97b5efe..7f9b096d8d572e0753ee84d060c4018fa6978a40 100644 (file)
@@ -62,7 +62,8 @@ static struct page *get_mapping_page(struct super_block *sb, pgoff_t index,
                page = read_cache_page(mapping, index, filler, sb);
        else {
                page = find_or_create_page(mapping, index, GFP_NOFS);
-               unlock_page(page);
+               if (page)
+                       unlock_page(page);
        }
        return page;
 }