aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/module.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/module.c')
-rw-r--r--kernel/module.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/kernel/module.c b/kernel/module.c
index 901cd6ac2f11..5d437bffd8dc 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -1933,8 +1933,15 @@ static struct module *load_module(void __user *umod,
1933 /* Set up license info based on the info section */ 1933 /* Set up license info based on the info section */
1934 set_license(mod, get_modinfo(sechdrs, infoindex, "license")); 1934 set_license(mod, get_modinfo(sechdrs, infoindex, "license"));
1935 1935
1936 /*
1937 * ndiswrapper is under GPL by itself, but loads proprietary modules.
1938 * Don't use add_taint_module(), as it would prevent ndiswrapper from
1939 * using GPL-only symbols it needs.
1940 */
1936 if (strcmp(mod->name, "ndiswrapper") == 0) 1941 if (strcmp(mod->name, "ndiswrapper") == 0)
1937 add_taint_module(mod, TAINT_PROPRIETARY_MODULE); 1942 add_taint(TAINT_PROPRIETARY_MODULE);
1943
1944 /* driverloader was caught wrongly pretending to be under GPL */
1938 if (strcmp(mod->name, "driverloader") == 0) 1945 if (strcmp(mod->name, "driverloader") == 0)
1939 add_taint_module(mod, TAINT_PROPRIETARY_MODULE); 1946 add_taint_module(mod, TAINT_PROPRIETARY_MODULE);
1940 1947
@@ -2171,10 +2178,20 @@ sys_init_module(void __user *umod,
2171 wake_up(&module_wq); 2178 wake_up(&module_wq);
2172 return ret; 2179 return ret;
2173 } 2180 }
2181 if (ret > 0) {
2182 printk(KERN_WARNING "%s: '%s'->init suspiciously returned %d, "
2183 "it should follow 0/-E convention\n"
2184 KERN_WARNING "%s: loading module anyway...\n",
2185 __func__, mod->name, ret,
2186 __func__);
2187 dump_stack();
2188 }
2174 2189
2175 /* Now it's a first class citizen! */ 2190 /* Now it's a first class citizen! Wake up anyone waiting for it. */
2176 mutex_lock(&module_mutex);
2177 mod->state = MODULE_STATE_LIVE; 2191 mod->state = MODULE_STATE_LIVE;
2192 wake_up(&module_wq);
2193
2194 mutex_lock(&module_mutex);
2178 /* Drop initial reference. */ 2195 /* Drop initial reference. */
2179 module_put(mod); 2196 module_put(mod);
2180 unwind_remove_table(mod->unwind_info, 1); 2197 unwind_remove_table(mod->unwind_info, 1);
@@ -2183,7 +2200,6 @@ sys_init_module(void __user *umod,
2183 mod->init_size = 0; 2200 mod->init_size = 0;
2184 mod->init_text_size = 0; 2201 mod->init_text_size = 0;
2185 mutex_unlock(&module_mutex); 2202 mutex_unlock(&module_mutex);
2186 wake_up(&module_wq);
2187 2203
2188 return 0; 2204 return 0;
2189} 2205}