Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Younger Liu and committed by
Linus Torvalds
2252b62a a3b25d9b

+2 -1
+2 -1
fs/logfs/segment.c
··· 62 62 page = read_cache_page(mapping, index, filler, sb); 63 63 else { 64 64 page = find_or_create_page(mapping, index, GFP_NOFS); 65 - unlock_page(page); 65 + if (page) 66 + unlock_page(page); 66 67 } 67 68 return page; 68 69 }