Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 77928
b: refs/heads/master
c: 6494a93
h: refs/heads/master
v: v3
  • Loading branch information
Greg Kroah-Hartman authored and Rusty Russell committed Jan 29, 2008
1 parent 7b153da commit bab0ab3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0aa5bd52d0c49ca56d24584c646e6544ccbb3dc9
refs/heads/master: 6494a93d55fad586238cc1940e846c6d03e1aaf6
10 changes: 10 additions & 0 deletions trunk/kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -1230,13 +1230,23 @@ void module_remove_modinfo_attrs(struct module *mod)
int mod_sysfs_init(struct module *mod)
{
int err;
struct kobject *kobj;

if (!module_sysfs_initialized) {
printk(KERN_ERR "%s: module sysfs not initialized\n",
mod->name);
err = -EINVAL;
goto out;
}

kobj = kset_find_obj(module_kset, mod->name);
if (kobj) {
printk(KERN_ERR "%s: module is already loaded\n", mod->name);
kobject_put(kobj);
err = -EINVAL;
goto out;
}

mod->mkobj.mod = mod;

memset(&mod->mkobj.kobj, 0, sizeof(mod->mkobj.kobj));
Expand Down

0 comments on commit bab0ab3

Please sign in to comment.