From a16b8a4bbed46a080660df3cca99fff27aa15cd6 Mon Sep 17 00:00:00 2001 From: Younger Liu Date: Tue, 17 Dec 2013 10:45:21 +1100 Subject: [PATCH] logfs: check for the return value after calling find_or_create_page() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- fs/logfs/segment.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; } -- 2.39.5