Commit ffa9f12a authored by Rusty Russell's avatar Rusty Russell
Browse files

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: default avatarKamalesh Babulal <>
Signed-off-by: default avatarRusty Russell <>
Cc: Eric Dumazet <>
Cc: Masami Hiramatsu <>
Cc: Américo Wang <>
Tested-by: default avatarKamalesh Babulal <>
parent a263f776
......@@ -2523,8 +2523,8 @@ static noinline struct module *load_module(void __user *umod,
#if defined(CONFIG_MODULE_UNLOAD) && defined(CONFIG_SMP)
module_free(mod, mod->module_init);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment