diff options
author | Liu Bo <bo.li.liu@oracle.com> | 2013-03-04 11:25:36 -0500 |
---|---|---|
committer | Josef Bacik <jbacik@fusionio.com> | 2013-03-04 16:33:22 -0500 |
commit | 8f71f3e0e4fb5a2445fb93d3057a33aefc4aa30d (patch) | |
tree | 3a138ce21038700b6cd81db196740de9657927a4 /fs/btrfs | |
parent | 00d71c9c17b1fd28fa54f323a29a0e23c6d3de40 (diff) |
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>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/relocation.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index ba5a3210da9a..16e0c6fbdbed 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c | |||
@@ -1269,6 +1269,8 @@ static int __update_reloc_root(struct btrfs_root *root, int del) | |||
1269 | } | 1269 | } |
1270 | spin_unlock(&rc->reloc_root_tree.lock); | 1270 | spin_unlock(&rc->reloc_root_tree.lock); |
1271 | 1271 | ||
1272 | if (!node) | ||
1273 | return 0; | ||
1272 | BUG_ON((struct btrfs_root *)node->data != root); | 1274 | BUG_ON((struct btrfs_root *)node->data != root); |
1273 | 1275 | ||
1274 | if (!del) { | 1276 | if (!del) { |