From: Jeff Mahoney Date: Thu, 1 Mar 2012 13:56:28 +0000 (+0100) Subject: btrfs: avoid NULL deref in btrfs_reserve_extent with DEBUG_ENOSPC X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=538042801a479ebd316582ad10a9c3156b5b7548;p=mv-sheeva.git 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 --- diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 37e0a800d34..c32a9bffe9e 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -5838,7 +5838,8 @@ again: 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); } }