Commit 62c61046 authored by Gu Zheng's avatar Gu Zheng Committed by Linus Torvalds

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().

[akpm@linux-foundation.org: fix layout, per Joel]
Signed-off-by: default avatarGu Zheng <guz.fnst@cn.fujitsu.com>
Acked-by: default avatarJoel Becker <jlbec@evilplan.org>
Cc: Mark Fasheh <mfasheh@suse.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 3964acd0
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment