From ffa9f12a41ec117207e8d953f90b9c179546c8d7 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 25 Sep 2009 00:32:59 -0600 Subject: module: don't call percpu_modfree on NULL pointer. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Rusty Russell Cc: Eric Dumazet Cc: Masami Hiramatsu Cc: Américo Wang Tested-by: Kamalesh Babulal --- kernel/module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'kernel/module.c') 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, free_unload: module_unload_free(mod); #if defined(CONFIG_MODULE_UNLOAD) && defined(CONFIG_SMP) - free_init: percpu_modfree(mod->refptr); + free_init: #endif module_free(mod, mod->module_init); free_core: -- cgit v1.2.3