Commit a8f97595 authored by Rusty Russell's avatar Rusty Russell Committed by Linus Torvalds

[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.
parent 6b90e276
......@@ -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);
......
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