From: Liu Bo Date: Mon, 4 Mar 2013 16:25:36 +0000 (+0000) Subject: Btrfs: check for NULL pointer in updating reloc roots X-Git-Tag: v3.9-rc2~3^2~2^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8f71f3e0e4fb5a2445fb93d3057a33aefc4aa30d;p=profile%2Fcommon%2Fkernel-common.git Btrfs: check for NULL pointer in updating reloc roots Add a check for NULL pointer to avoid invalid reference. Signed-off-by: Liu Bo Signed-off-by: Josef Bacik --- diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index ba5a321..16e0c6f 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c @@ -1269,6 +1269,8 @@ static int __update_reloc_root(struct btrfs_root *root, int del) } spin_unlock(&rc->reloc_root_tree.lock); + if (!node) + return 0; BUG_ON((struct btrfs_root *)node->data != root); if (!del) {