Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 75844
b: refs/heads/master
c: 97c146e
h: refs/heads/master
v: v3
  • Loading branch information
Kay Sievers authored and Greg Kroah-Hartman committed Jan 25, 2008
1 parent 712e588 commit 2226750
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: da231fd5d113ab6da5dab7a2d2c38d0a540f939c
refs/heads/master: 97c146ef075dc40ae34407c03d3860fc3850b8e8
15 changes: 7 additions & 8 deletions trunk/kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -1227,6 +1227,8 @@ int mod_sysfs_init(struct module *mod)

kobject_init(&mod->mkobj.kobj);

/* delay uevent until full sysfs population */
err = kobject_add(&mod->mkobj.kobj);
out:
return err;
}
Expand All @@ -1237,11 +1239,6 @@ int mod_sysfs_setup(struct module *mod,
{
int err;

/* delay uevent until full sysfs population */
err = kobject_add(&mod->mkobj.kobj);
if (err)
goto out;

mod->holders_dir = kobject_create_and_add("holders", &mod->mkobj.kobj);
if (!mod->holders_dir) {
err = -ENOMEM;
Expand All @@ -1266,7 +1263,6 @@ int mod_sysfs_setup(struct module *mod,
out_unreg:
kobject_del(&mod->mkobj.kobj);
kobject_put(&mod->mkobj.kobj);
out:
return err;
}
#endif
Expand Down Expand Up @@ -1883,10 +1879,10 @@ static struct module *load_module(void __user *umod,
/* Now we've moved module, initialize linked lists, etc. */
module_unload_init(mod);

/* Initialize kobject, so we can reference it. */
/* add kobject, so we can reference it. */
err = mod_sysfs_init(mod);
if (err)
goto cleanup;
goto free_unload;

/* Set up license info based on the info section */
set_license(mod, get_modinfo(sechdrs, infoindex, "license"));
Expand Down Expand Up @@ -2056,6 +2052,9 @@ static struct module *load_module(void __user *umod,
arch_cleanup:
module_arch_cleanup(mod);
cleanup:
kobject_del(&mod->mkobj.kobj);
kobject_put(&mod->mkobj.kobj);
free_unload:
module_unload_free(mod);
module_free(mod, mod->module_init);
free_core:
Expand Down

0 comments on commit 2226750

Please sign in to comment.