Btrfs: check for NULL pointer in updating reloc roots

Add a check for NULL pointer to avoid invalid reference.

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
This commit is contained in:
Liu Bo 2013-03-04 16:25:36 +00:00 committed by Josef Bacik
parent 00d71c9c17
commit 8f71f3e0e4
1 changed files with 2 additions and 0 deletions

View File

@ -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) {