Commit 2252b62a56601c9e31396da230b4ce792f167fb4

Authored by Younger Liu
Committed by Linus Torvalds
1 parent a3b25d9b77

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>

Showing 1 changed file with 2 additions and 1 deletions Side-by-side Diff

... ... @@ -62,7 +62,8 @@
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 }