From: Younger Liu Date: Thu, 23 Jan 2014 23:53:47 +0000 (-0800) Subject: logfs: check for the return value after calling find_or_create_page() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2252b62a56601c9e31396da230b4ce792f167fb4;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Cc: Younger Liu Cc: Vyacheslav Dubeyko Reviewed-by: Prasad Joshi Cc: Jörn Engel Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- 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; }