Skip to content

Commit

Permalink
btrfs: avoid NULL deref in btrfs_reserve_extent with DEBUG_ENOSPC
Browse files Browse the repository at this point in the history
 __find_space_info can return NULL but we don't check it before calling
 dump_space_info().

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
  • Loading branch information
Jeff Mahoney authored and David Sterba committed Mar 22, 2012
1 parent d5c13f9 commit 5380428
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/btrfs/extent-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -5838,7 +5838,8 @@ int btrfs_reserve_extent(struct btrfs_trans_handle *trans,
printk(KERN_ERR "btrfs allocation failed flags %llu, "
"wanted %llu\n", (unsigned long long)data,
(unsigned long long)num_bytes);
dump_space_info(sinfo, num_bytes, 1);
if (sinfo)
dump_space_info(sinfo, num_bytes, 1);
}
}

Expand Down

0 comments on commit 5380428

Please sign in to comment.