Re: [PATCH] Fix for module initialization failure

From: Paul Mackerras
Date: Wed Oct 29 2003 - 19:02:58 EST


Rusty Russell writes:

> Need a module_arch_cleanup() after a successful module_finalize()
> call: it was missing in the case where module->init() fails. Since
> module_arch_cleanup() is a noop on x86, I didn't spot it earlier.
>
> Thanks to Paul Mackerras for prodding me about this again...

Linus: this fixes a real bug which causes an oops on PPC in the case
where you try to load one module, but the init routine fails, and then
you try to load another module. What happens is that the
module_finalize() call on the first module adds the module to a list
used in BUG() handling. If the init routine fails, the code currently
doesn't call module_arch_cleanup(), which is where we remove the
module from the list used for BUG handling. When you try to load the
next module, the BUG list head is pointing to a module which is no
longer there and you get an oops.

Please apply.

Thanks,
Paul.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/