]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Fix for module initialization failure
authorRusty Russell <rusty@rustcorp.com.au>
Wed, 29 Oct 2003 09:35:41 +0000 (01:35 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Wed, 29 Oct 2003 09:35:41 +0000 (01:35 -0800)
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

index e87659e3b3e48663687af2fcc308302822a4092a..2997c3e89974f2228c4a97abfe587f9c8b2e26fe 100644 (file)
@@ -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);