]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
staging: lustre: obdclass: Remove a attribute group from a kobject
authorArvind Yadav <arvind.yadav.cs@gmail.com>
Sat, 25 Nov 2017 06:39:30 +0000 (12:09 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Nov 2017 13:14:44 +0000 (14:14 +0100)
All attribute group created during class_procfs_init() should be
removed.
if class_procfs_init() will fail and also in class_procfs_clean().

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/obdclass/linux/linux-module.c

index fc59f29a4290670081becfcb105fd93937de145e..57951237def245fd698d61730d2b030d67de1ca3 100644 (file)
@@ -501,6 +501,7 @@ int class_procfs_init(void)
                rc = debugfs_lustre_root ? PTR_ERR(debugfs_lustre_root)
                                         : -ENOMEM;
                debugfs_lustre_root = NULL;
+               sysfs_remove_group(lustre_kobj, &lustre_attr_group);
                kobject_put(lustre_kobj);
                goto out;
        }
@@ -509,6 +510,7 @@ int class_procfs_init(void)
                                   &obd_device_list_fops);
        if (IS_ERR_OR_NULL(file)) {
                rc = file ? PTR_ERR(file) : -ENOMEM;
+               sysfs_remove_group(lustre_kobj, &lustre_attr_group);
                kobject_put(lustre_kobj);
                goto out;
        }
@@ -522,6 +524,7 @@ int class_procfs_clean(void)
 
        debugfs_lustre_root = NULL;
 
+       sysfs_remove_group(lustre_kobj, &lustre_attr_group);
        kobject_put(lustre_kobj);
 
        return 0;