Qinghuang Feng 7e6628544a Btrfs: open_ctree() error handling can oops on fs_info
a bug in open_ctree:

struct btrfs_root *open_ctree(..)
{
....
	if (!extent_root || !tree_root || !fs_info ||
	    !chunk_root || !dev_root || !csum_root) {
		err = -ENOMEM;
		goto fail;
//When code flow goes to "fail", fs_info may be NULL or uninitialized.
	}
....

fail:
	btrfs_close_devices(fs_info->fs_devices);// !
	btrfs_mapping_tree_free(&fs_info->mapping_tree);// !

	kfree(extent_root);
	kfree(tree_root);
	bdi_destroy(&fs_info->bdi);// !
...
)

Signed-off-by: Qinghuang Feng <qhfeng.kernel@gmail.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2009-01-21 10:49:16 -05:00
..
2008-10-27 08:40:17 -07:00
2008-08-20 15:40:32 -07:00
2008-10-13 09:47:43 +11:00
2008-11-13 13:22:34 -06:00
2008-11-06 15:41:22 -08:00
2008-04-29 08:06:00 -07:00
2008-11-01 09:49:46 -07:00
2008-10-23 05:12:58 -04:00
2008-10-17 02:38:36 +11:00
2008-12-01 19:55:25 -08:00
2008-12-16 18:26:16 -08:00
2008-11-18 15:08:56 +01:00
2008-12-10 08:01:54 -08:00
2008-11-27 17:38:28 +01:00
2008-07-26 20:53:40 -04:00
2008-07-26 12:00:08 -07:00
2008-10-16 11:21:38 -07:00
2008-10-09 08:57:05 +02:00
2008-12-04 04:22:57 -05:00
2008-11-27 17:38:28 +01:00
2008-10-23 05:12:59 -04:00
2008-05-01 13:08:16 -04:00
2008-12-09 19:36:38 -08:00
2008-10-30 11:38:45 -07:00
2008-11-19 18:49:59 -08:00
2008-11-12 17:17:17 -08:00
2008-02-14 21:13:33 -08:00
2008-11-01 09:49:46 -07:00
2008-07-25 10:53:35 -07:00
2008-10-30 11:38:45 -07:00