aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGu Zheng <[email protected]>2013-07-31 13:53:29 -0700
committerLinus Torvalds <[email protected]>2013-07-31 14:41:02 -0700
commit62c610460d73fcfa5637cb497c6923ef1c42b12d (patch)
tree4bd1f444e4f1b15cb9d18e94bf1dfb4749c1e5aa
parent3964acd0dbec123aa0a621973a2a0580034b4788 (diff)
ocfs2/refcounttree: add the missing NULL check of the return value of find_or_create_page()
Add the missing NULL check of the return value of find_or_create_page() in function ocfs2_duplicate_clusters_by_page(). [[email protected]: fix layout, per Joel] Signed-off-by: Gu Zheng <[email protected]> Acked-by: Joel Becker <[email protected]> Cc: Mark Fasheh <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--fs/ocfs2/refcounttree.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c
index 998b17eda09d..9f6b96a09615 100644
--- a/fs/ocfs2/refcounttree.c
+++ b/fs/ocfs2/refcounttree.c
@@ -2965,6 +2965,11 @@ int ocfs2_duplicate_clusters_by_page(handle_t *handle,
to = map_end & (PAGE_CACHE_SIZE - 1);
page = find_or_create_page(mapping, page_index, GFP_NOFS);
+ if (!page) {
+ ret = -ENOMEM;
+ mlog_errno(ret);
+ break;
+ }
/*
* In case PAGE_CACHE_SIZE <= CLUSTER_SIZE, This page