nilfs2: fix memory leak in nilfs_sysfs_create_##name##_group
[linux-2.6-microblaze.git] / fs / nilfs2 / sysfs.c
index ec85ac5..6305e4e 100644 (file)
@@ -79,8 +79,8 @@ static int nilfs_sysfs_create_##name##_group(struct the_nilfs *nilfs) \
        err = kobject_init_and_add(kobj, &nilfs_##name##_ktype, parent, \
                                    #name); \
        if (err) \
-               return err; \
-       return 0; \
+               kobject_put(kobj); \
+       return err; \
 } \
 static void nilfs_sysfs_delete_##name##_group(struct the_nilfs *nilfs) \
 { \