From: Younger Liu Date: Mon, 16 Dec 2013 23:45:21 +0000 (+1100) Subject: logfs: check for the return value after calling find_or_create_page() X-Git-Tag: next-20131220~2^2~114 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=a16b8a4bbed46a080660df3cca99fff27aa15cd6;p=karo-tx-linux.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 --- 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; }