Skip to content

Commit 2252b62

Browse files
Younger Liutorvalds
authored andcommitted
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>
1 parent a3b25d9 commit 2252b62

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎fs/logfs/segment.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ static struct page *get_mapping_page(struct super_block *sb, pgoff_t index,
6262
page = read_cache_page(mapping, index, filler, sb);
6363
else {
6464
page = find_or_create_page(mapping, index, GFP_NOFS);
65-
unlock_page(page);
65+
if (page)
66+
unlock_page(page);
6667
}
6768
return page;
6869
}

0 commit comments

Comments
 (0)