Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 53804280 authored by Jeff Mahoney's avatar Jeff Mahoney Committed by David Sterba
Browse files

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: default avatarJeff Mahoney <jeffm@suse.com>
parent d5c13f92
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -5838,6 +5838,7 @@ 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);
			if (sinfo)
				dump_space_info(sinfo, num_bytes, 1);
		}
	}