From a8f975952030c0ccc5de4ec70c7fd7d422beb1fb Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 29 Oct 2003 01:35:41 -0800 Subject: [PATCH] [PATCH] Fix for module initialization failure Bug reported by Paul Mackerras: if a module parameter fails, we didn't call module_arch_cleanup(). On x86 this was harmless (module_arch_cleanup() is a no-op), but on other architectures like PPC this causes inconsistent data structures and subsequent oopses. --- kernel/module.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/module.c b/kernel/module.c index e87659e3b3e48..2997c3e89974f 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -1658,7 +1658,7 @@ static struct module *load_module(void __user *umod, NULL); } if (err < 0) - goto cleanup; + goto arch_cleanup; /* Get rid of temporary copy */ vfree(hdr); @@ -1666,6 +1666,8 @@ static struct module *load_module(void __user *umod, /* Done! */ return mod; + arch_cleanup: + module_arch_cleanup(mod); cleanup: module_unload_free(mod); module_free(mod, mod->module_init); -- 2.53.0