diff options
author | Shen Feng <shen@cn.fujitsu.com> | 2009-01-05 21:43:42 +0100 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2009-01-05 21:43:42 +0100 |
commit | dd3fd8bdf7238f99561ee236060b04d5b9a84953 (patch) | |
tree | 5ed82a1018b353b17a87ca9206427a305d103371 /fs | |
parent | Btrfs: fix a memory leak in btrfs_get_sb (diff) | |
download | linux-dd3fd8bdf7238f99561ee236060b04d5b9a84953.tar.xz linux-dd3fd8bdf7238f99561ee236060b04d5b9a84953.zip |
Btrfs: do not call kfree if kmalloc failed in btrfs_sysfs_add_super
Signed-off-by: Shen Feng <shen@cn.fujitsu.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/sysfs.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c index 300076e66765..04087c020845 100644 --- a/fs/btrfs/sysfs.c +++ b/fs/btrfs/sysfs.c @@ -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; } |