Commit 4f3f0730 authored by Arvind Yadav's avatar Arvind Yadav Committed by Greg Kroah-Hartman

staging: lustre: obdclass: Remove a attribute group from a kobject

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: default avatarArvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c127e451
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment