ral(4) cardbus crash

Max Herrgård herrgard at gmail.com
Mon Jul 19 13:41:46 PDT 2010


Nicolas Thery wrote:
> 2010/6/21 Max Herrgård <herrgard at gmail.com>:
>> Hi,
>> 
>> I get this crash when plugging in my ral(4) cardbus card.
> [...]
>> #14 0xc0296ccb in ral_pci_attach (dev=0xc14d3a58) at /usr/src/sys/dev/netif/ral/if_ral_pci.c:209
> 
> It looks like sc_ifp is initialized after ifp  = sc->sc_ifp.
> 
> Could you try this patch please?
> 
> 
> diff --git a/sys/dev/netif/ral/if_ral_pci.c b/sys/dev/netif/ral/if_ral_pci.c
> index 4af51b1..c94fad7 100644
> --- a/sys/dev/netif/ral/if_ral_pci.c
> +++ b/sys/dev/netif/ral/if_ral_pci.c
> @@ -164,7 +164,7 @@ ral_pci_attach(device_t dev)
> {
>        struct ral_pci_softc *psc = device_get_softc(dev);
>        struct rt2560_softc *sc = &psc->u.sc_rt2560;
> -       struct ifnet *ifp = sc->sc_ifp;
> +       struct ifnet *ifp;
>        int error;
> 
>        if (pci_get_powerstate(dev) != PCI_POWERSTATE_D0) {
> @@ -202,6 +202,7 @@ ral_pci_attach(device_t dev)
>        error = (*psc->sc_opns->attach)(dev, pci_get_device(dev));
>        if (error != 0)
>                return error;
> +       ifp = sc->sc_ifp;
> 
>        /*
>         * Hook our interrupt after all initialization is complete.

Yup. This patch fixes this crash.

Thank you,
Max







More information about the Bugs mailing list