Btrfs: do not call kfree if kmalloc failed in btrfs_sysfs_add_super

Signed-off-by: Shen Feng <shen@cn.fujitsu.com>
This commit is contained in:
Shen Feng 2009-01-05 15:43:42 -05:00 committed by Chris Mason
parent 1f48366084
commit dd3fd8bdf7

View File

@ -212,14 +212,13 @@ int btrfs_sysfs_add_super(struct btrfs_fs_info *fs)
fs->super_kobj.kset = btrfs_kset;
error = kobject_init_and_add(&fs->super_kobj, &btrfs_super_ktype,
NULL, "%s", name);
kfree(name);
if (error)
goto fail;
kfree(name);
return 0;
fail:
kfree(name);
printk(KERN_ERR "btrfs: sysfs creation for super failed\n");
return error;
}