On Wed, May 9, 2018 at 3:04 AM, Finn Thain <[email protected]> wrote:
> Loading a NuBus driver module on a non-NuBus machine triggers the
> BUG_ON(!drv->bus->p) in driver_register(), because bus_register() was
> not called, because it is conditional on MACH_IS_MAC.
>
> Fix the crash by calling bus_register() unconditionally. Call it from
> a postcore_initcall(), like other busses do.
>
> Hence, the bus type is available for device_register(), which happens
> in a subsys initcall, and for driver_register(), which happens in a
> device or module initcall.
>
> Cc: Greg Kroah-Hartman <[email protected]>
> Reported-by: Michael Schmitz <[email protected]>
> Tested-by: Stan Johnson <[email protected]>
> Fixes: 7f86c765a6a2 ("nubus: Add support for the driver model")
> Signed-off-by: Finn Thain <[email protected]>

Reviewed-by: Geert Uytterhoeven <[email protected]>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

Reply via email to