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:
parent
00d71c9c17
commit
8f71f3e0e4
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue