diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2009-09-25 02:32:59 -0400 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2009-09-24 11:02:59 -0400 |
commit | ffa9f12a41ec117207e8d953f90b9c179546c8d7 (patch) | |
tree | c587166a485b631bc8645caec4eff6f2e9f295fe /kernel/module.c | |
parent | a263f7763c364015f92e7c097fa46c6673f6fcb0 (diff) |
module: don't call percpu_modfree on NULL pointer.
The general one handles NULL, the static obsolescent
(CONFIG_HAVE_LEGACY_PER_CPU_AREA) one in module.c doesn't; Eric's
commit 720eba31 assumed it did, and various frobbings since then kept
that assumption.
All other callers in module.c all protect it with an if; this effectively
does the same as free_init is only goto if we fail percpu_modalloc().
Reported-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: Eric Dumazet <dada1@cosmosbay.com>
Cc: Masami Hiramatsu <mhiramat@redhat.com>
Cc: Américo Wang <xiyou.wangcong@gmail.com>
Tested-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/module.c')
-rw-r--r-- | kernel/module.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/module.c b/kernel/module.c index c54f10d90e1c..5a29397ca4b6 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
@@ -2523,8 +2523,8 @@ static noinline struct module *load_module(void __user *umod, | |||
2523 | free_unload: | 2523 | free_unload: |
2524 | module_unload_free(mod); | 2524 | module_unload_free(mod); |
2525 | #if defined(CONFIG_MODULE_UNLOAD) && defined(CONFIG_SMP) | 2525 | #if defined(CONFIG_MODULE_UNLOAD) && defined(CONFIG_SMP) |
2526 | free_init: | ||
2527 | percpu_modfree(mod->refptr); | 2526 | percpu_modfree(mod->refptr); |
2527 | free_init: | ||
2528 | #endif | 2528 | #endif |
2529 | module_free(mod, mod->module_init); | 2529 | module_free(mod, mod->module_init); |
2530 | free_core: | 2530 | free_core: |