diff mbox

[Bugme-new,Bug,29302] New: Null pointer dereference with large max_sectors_kb

Message ID 1298059754-sup-2258@think (mailing list archive)
State New, archived
Headers show

Commit Message

Chris Mason Feb. 18, 2011, 8:18 p.m. UTC
None
diff mbox

Patch

diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index d39a989..d8f7ee0 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -757,6 +757,10 @@  static struct dentry *btrfs_mount(struct file_system_type *fs_type, int flags,
 	tree_root->fs_info = fs_info;
 
 	bdev = fs_devices->latest_bdev;
+	if (!bdev) {
+		printk(KERN_CRIT "btrfs read devices failed on %s\n", dev_name);
+		goto error_close_devices;
+	}
 	s = sget(fs_type, btrfs_test_super, btrfs_set_super, tree_root);
 	if (IS_ERR(s))
 		goto error_s;