aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorYounger Liu <liuyiyang@hisense.com>2014-01-23 18:53:47 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-01-23 19:36:54 -0500
commit2252b62a56601c9e31396da230b4ce792f167fb4 (patch)
tree02a0cf2f7ba9a1367d8c13752b67d3819149b921 /fs
parenta3b25d9b774fbda2e6add28cf792941fd98fa999 (diff)
logfs: check for the return value after calling find_or_create_page()
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> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/logfs/segment.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/logfs/segment.c b/fs/logfs/segment.c
index d448a777166b..7f9b096d8d57 100644
--- a/fs/logfs/segment.c
+++ b/fs/logfs/segment.c
@@ -62,7 +62,8 @@ static struct page *get_mapping_page(struct super_block *sb, pgoff_t index,
62 page = read_cache_page(mapping, index, filler, sb); 62 page = read_cache_page(mapping, index, filler, sb);
63 else { 63 else {
64 page = find_or_create_page(mapping, index, GFP_NOFS); 64 page = find_or_create_page(mapping, index, GFP_NOFS);
65 unlock_page(page); 65 if (page)
66 unlock_page(page);
66 } 67 }
67 return page; 68 return page;
68} 69}