diff options
Diffstat (limited to 'kernel/module.c')
-rw-r--r-- | kernel/module.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/module.c b/kernel/module.c index 2a19cd47c046..b7fe6e840963 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
@@ -1054,6 +1054,12 @@ static int mod_sysfs_setup(struct module *mod, | |||
1054 | { | 1054 | { |
1055 | int err; | 1055 | int err; |
1056 | 1056 | ||
1057 | if (!module_subsys.kset.subsys) { | ||
1058 | printk(KERN_ERR "%s: module_subsys not initialized\n", | ||
1059 | mod->name); | ||
1060 | err = -EINVAL; | ||
1061 | goto out; | ||
1062 | } | ||
1057 | memset(&mod->mkobj.kobj, 0, sizeof(mod->mkobj.kobj)); | 1063 | memset(&mod->mkobj.kobj, 0, sizeof(mod->mkobj.kobj)); |
1058 | err = kobject_set_name(&mod->mkobj.kobj, "%s", mod->name); | 1064 | err = kobject_set_name(&mod->mkobj.kobj, "%s", mod->name); |
1059 | if (err) | 1065 | if (err) |