From: Shen Feng Date: Mon, 5 Jan 2009 20:43:42 +0000 (-0500) Subject: Btrfs: do not call kfree if kmalloc failed in btrfs_sysfs_add_super X-Git-Tag: v2.6.29-rc1~27^2~9^2~5 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=dd3fd8bdf7238f99561ee236060b04d5b9a84953;p=linux-2.6-omap-h63xx.git Btrfs: do not call kfree if kmalloc failed in btrfs_sysfs_add_super Signed-off-by: Shen Feng --- diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c index 300076e6676..04087c02084 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; }