summaryrefslogtreecommitdiffstats
path: root/fs/logfs
diff options
context:
space:
mode:
authorYounger Liu <liuyiyang@hisense.com>2014-01-24 00:53:47 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2014-01-24 01:36:54 +0100
commit2252b62a56601c9e31396da230b4ce792f167fb4 (patch)
tree02a0cf2f7ba9a1367d8c13752b67d3819149b921 /fs/logfs
parentdrivers/block/Kconfig: update RAM block device module name (diff)
downloadlinux-2252b62a56601c9e31396da230b4ce792f167fb4.tar.xz
linux-2252b62a56601c9e31396da230b4ce792f167fb4.zip
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/logfs')
-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,
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;
}