Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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