diff --git a/kernel/ksysfs.c b/kernel/ksysfs.c index 1081aff5fb9efad74a16fefe0160d2ed097f473d..e53bc30e9ba5aa8b55311fd6700191b0f21a9597 100644 --- a/kernel/ksysfs.c +++ b/kernel/ksysfs.c @@ -154,7 +154,7 @@ static int __init ksysfs_init(void) 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 89cd4c7361d8ba3b77bc4d3013574baf8c81c50e..dcb8a2cbf75e2152496ebe4ca25d19ac50018401 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); } /* diff --git a/lib/kobject.c b/lib/kobject.c index 4fce5ca42c2e7facb093784e06d46571b4a6ffb3..462946ee3e64c14dc28f9c420f18a1273eb92c0a 100644 --- a/lib/kobject.c +++ b/lib/kobject.c @@ -664,7 +664,7 @@ struct kobject *kobject_create(void) * * This function creates a kset structure dynamically and registers it * with sysfs. When you are finished with this structure, call - * kobject_unregister() and the structure will be dynamically freed when + * kobject_put() and the structure will be dynamically freed when * it is no longer being used. * * If the kobject was not able to be created, NULL will be returned. @@ -761,7 +761,7 @@ void kset_unregister(struct kset * k) { if (!k) return; - kobject_unregister(&k->kobj); + kobject_put(&k->kobj); } diff --git a/net/bridge/br_sysfs_br.c b/net/bridge/br_sysfs_br.c index 4e7f91fafeddf44ebbd03773ca4134fb8225ec23..9cf0538d1717e4b633c6bc2e732bd64582b1ca42 100644 --- a/net/bridge/br_sysfs_br.c +++ b/net/bridge/br_sysfs_br.c @@ -447,7 +447,7 @@ void br_sysfs_delbr(struct net_device *dev) struct kobject *kobj = &dev->dev.kobj; struct net_bridge *br = netdev_priv(dev); - kobject_unregister(br->ifobj); + kobject_put(br->ifobj); sysfs_remove_bin_file(kobj, &bridge_forward); sysfs_remove_group(kobj, &bridge_group); } diff --git a/security/inode.c b/security/inode.c index def0cc1b07f235fcbab3be073d12ae4b43610347..acc6cf0d79001fa06d53c5b592fb4c90f5ea88a2 100644 --- a/security/inode.c +++ b/security/inode.c @@ -327,7 +327,7 @@ static int __init securityfs_init(void) retval = register_filesystem(&fs_type); if (retval) - kobject_unregister(security_kobj); + kobject_put(security_kobj); return retval; }