Commit 8f71f3e0 authored by Liu Bo's avatar Liu Bo Committed by Josef Bacik
Browse files

Btrfs: check for NULL pointer in updating reloc roots



Add a check for NULL pointer to avoid invalid reference.

Signed-off-by: default avatarLiu Bo <bo.li.liu@oracle.com>
Signed-off-by: default avatarJosef Bacik <jbacik@fusionio.com>
parent 00d71c9c
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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) {