mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-01-18 23:59:53 +00:00
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:
parent
1f48366084
commit
dd3fd8bdf7
@ -212,14 +212,13 @@ int btrfs_sysfs_add_super(struct btrfs_fs_info *fs)
|
|||||||
fs->super_kobj.kset = btrfs_kset;
|
fs->super_kobj.kset = btrfs_kset;
|
||||||
error = kobject_init_and_add(&fs->super_kobj, &btrfs_super_ktype,
|
error = kobject_init_and_add(&fs->super_kobj, &btrfs_super_ktype,
|
||||||
NULL, "%s", name);
|
NULL, "%s", name);
|
||||||
|
kfree(name);
|
||||||
if (error)
|
if (error)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
kfree(name);
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
kfree(name);
|
|
||||||
printk(KERN_ERR "btrfs: sysfs creation for super failed\n");
|
printk(KERN_ERR "btrfs: sysfs creation for super failed\n");
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user