aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/module.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/module.c')
-rw-r--r--kernel/module.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/kernel/module.c b/kernel/module.c
index f77ac320d0b5..b862fdb6a372 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -1491,6 +1491,9 @@ static void free_module(struct module *mod)
1491 /* Module unload stuff */ 1491 /* Module unload stuff */
1492 module_unload_free(mod); 1492 module_unload_free(mod);
1493 1493
1494 /* Free any allocated parameters. */
1495 destroy_params(mod->kp, mod->num_kp);
1496
1494 /* release any pointers to mcount in this module */ 1497 /* release any pointers to mcount in this module */
1495 ftrace_release(mod->module_core, mod->core_size); 1498 ftrace_release(mod->module_core, mod->core_size);
1496 1499
@@ -1898,8 +1901,7 @@ static noinline struct module *load_module(void __user *umod,
1898 unsigned int symindex = 0; 1901 unsigned int symindex = 0;
1899 unsigned int strindex = 0; 1902 unsigned int strindex = 0;
1900 unsigned int modindex, versindex, infoindex, pcpuindex; 1903 unsigned int modindex, versindex, infoindex, pcpuindex;
1901 unsigned int num_kp, num_mcount; 1904 unsigned int num_mcount;
1902 struct kernel_param *kp;
1903 struct module *mod; 1905 struct module *mod;
1904 long err = 0; 1906 long err = 0;
1905 void *percpu = NULL, *ptr = NULL; /* Stops spurious gcc warning */ 1907 void *percpu = NULL, *ptr = NULL; /* Stops spurious gcc warning */
@@ -2144,8 +2146,8 @@ static noinline struct module *load_module(void __user *umod,
2144 2146
2145 /* Now we've got everything in the final locations, we can 2147 /* Now we've got everything in the final locations, we can
2146 * find optional sections. */ 2148 * find optional sections. */
2147 kp = section_objs(hdr, sechdrs, secstrings, "__param", sizeof(*kp), 2149 mod->kp = section_objs(hdr, sechdrs, secstrings, "__param",
2148 &num_kp); 2150 sizeof(*mod->kp), &mod->num_kp);
2149 mod->syms = section_objs(hdr, sechdrs, secstrings, "__ksymtab", 2151 mod->syms = section_objs(hdr, sechdrs, secstrings, "__ksymtab",
2150 sizeof(*mod->syms), &mod->num_syms); 2152 sizeof(*mod->syms), &mod->num_syms);
2151 mod->crcs = section_addr(hdr, sechdrs, secstrings, "__kcrctab"); 2153 mod->crcs = section_addr(hdr, sechdrs, secstrings, "__kcrctab");
@@ -2291,11 +2293,11 @@ static noinline struct module *load_module(void __user *umod,
2291 */ 2293 */
2292 list_add_rcu(&mod->list, &modules); 2294 list_add_rcu(&mod->list, &modules);
2293 2295
2294 err = parse_args(mod->name, mod->args, kp, num_kp, NULL); 2296 err = parse_args(mod->name, mod->args, mod->kp, mod->num_kp, NULL);
2295 if (err < 0) 2297 if (err < 0)
2296 goto unlink; 2298 goto unlink;
2297 2299
2298 err = mod_sysfs_setup(mod, kp, num_kp); 2300 err = mod_sysfs_setup(mod, mod->kp, mod->num_kp);
2299 if (err < 0) 2301 if (err < 0)
2300 goto unlink; 2302 goto unlink;
2301 add_sect_attrs(mod, hdr->e_shnum, secstrings, sechdrs); 2303 add_sect_attrs(mod, hdr->e_shnum, secstrings, sechdrs);