summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/ksysfs.c2
-rw-r--r--kernel/module.c9
2 files changed, 5 insertions, 6 deletions
diff --git a/kernel/ksysfs.c b/kernel/ksysfs.c
index 1081aff..e53bc30 100644
--- a/kernel/ksysfs.c
+++ b/kernel/ksysfs.c
@@ -154,7 +154,7 @@ notes_exit:
group_exit:
sysfs_remove_group(kernel_kobj, &kernel_attr_group);
kset_exit:
- kobject_unregister(kernel_kobj);
+ kobject_put(kernel_kobj);
exit:
return error;
}
diff --git a/kernel/module.c b/kernel/module.c
index 89cd4c7..dcb8a2c 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -1257,9 +1257,8 @@ int mod_sysfs_setup(struct module *mod,
out_unreg_param:
module_param_sysfs_remove(mod);
out_unreg_holders:
- kobject_unregister(mod->holders_dir);
+ kobject_put(mod->holders_dir);
out_unreg:
- kobject_del(&mod->mkobj.kobj);
kobject_put(&mod->mkobj.kobj);
return err;
}
@@ -1269,9 +1268,9 @@ static void mod_kobject_remove(struct module *mod)
{
module_remove_modinfo_attrs(mod);
module_param_sysfs_remove(mod);
- kobject_unregister(mod->mkobj.drivers_dir);
- kobject_unregister(mod->holders_dir);
- kobject_unregister(&mod->mkobj.kobj);
+ kobject_put(mod->mkobj.drivers_dir);
+ kobject_put(mod->holders_dir);
+ kobject_put(&mod->mkobj.kobj);
}
/*
OpenPOWER on IntegriCloud