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

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
...@@ -1269,6 +1269,8 @@ static int __update_reloc_root(struct btrfs_root *root, int del) ...@@ -1269,6 +1269,8 @@ static int __update_reloc_root(struct btrfs_root *root, int del)
} }
spin_unlock(&rc->reloc_root_tree.lock); spin_unlock(&rc->reloc_root_tree.lock);
if (!node)
return 0;
BUG_ON((struct btrfs_root *)node->data != root); BUG_ON((struct btrfs_root *)node->data != root);
if (!del) { if (!del) {
......
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