[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <51DA6FD5.8050300@cn.fujitsu.com>
Date: Mon, 08 Jul 2013 15:52:53 +0800
From: Gu Zheng <guz.fnst@...fujitsu.com>
To: mfasheh@...e.com, jlbec@...lplan.org
CC: ocfs2-devel@....oracle.com,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: [PATCH] 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().
Signed-off-by: Gu Zheng <guz.fnst@...fujitsu.com>
---
fs/ocfs2/refcounttree.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c
index 998b17e..456d0e4 100644
--- a/fs/ocfs2/refcounttree.c
+++ b/fs/ocfs2/refcounttree.c
@@ -2965,7 +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
* can't be dirtied before we CoW it out.
--
1.7.7
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists