diff options
author | Jeff Mahoney <jeffm@suse.com> | 2012-03-01 08:56:28 -0500 |
---|---|---|
committer | David Sterba <dsterba@suse.cz> | 2012-03-21 20:45:32 -0400 |
commit | 538042801a479ebd316582ad10a9c3156b5b7548 (patch) | |
tree | 06582e3ca9e4d8a7c0c4117ee448bfda67b73092 /fs/btrfs/extent-tree.c | |
parent | d5c13f927fe77b11a67f79559808c68b26474c77 (diff) |
btrfs: avoid NULL deref in btrfs_reserve_extent with DEBUG_ENOSPC
__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>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r-- | fs/btrfs/extent-tree.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 37e0a800d34e..c32a9bffe9e4 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
@@ -5838,7 +5838,8 @@ again: | |||
5838 | printk(KERN_ERR "btrfs allocation failed flags %llu, " | 5838 | printk(KERN_ERR "btrfs allocation failed flags %llu, " |
5839 | "wanted %llu\n", (unsigned long long)data, | 5839 | "wanted %llu\n", (unsigned long long)data, |
5840 | (unsigned long long)num_bytes); | 5840 | (unsigned long long)num_bytes); |
5841 | dump_space_info(sinfo, num_bytes, 1); | 5841 | if (sinfo) |
5842 | dump_space_info(sinfo, num_bytes, 1); | ||
5842 | } | 5843 | } |
5843 | } | 5844 | } |
5844 | 5845 | ||