Skip to content

Commit

Permalink
Btrfs: check for NULL pointer in updating reloc roots
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Liu Bo authored and Josef Bacik committed Mar 4, 2013
1 parent 00d71c9 commit 8f71f3e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/btrfs/relocation.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 8f71f3e

Please sign in to comment.