[Devel] Re: [patch 1/1] fix bad netif_carrier_off place
Pavel Emelyanov
xemul at openvz.org
Wed Sep 19 01:35:43 PDT 2007
> From: Daniel Lezcano <dlezcano at fr.ibm.com>
>
> If the netif_carrier_off is called before register_netdev
> that will use and generate an event for a non initialized network
> device and that leads to a Oops.
>
> I moved the netif_carrier_off from the setup function after each
> register_netdev call.
>
> Signed-off-by: Daniel Lezcano <dlezcano at fr.ibm.com>
Acked-by: Pavel Emelyanov <xemul at openvz.org>
Eric, if you managed to reproduce your oopses, does this patch help?
BTW, this problem exists for some other drivers, no? E.g.
xpnet_init() does the same thing and probably oopses as well.
> ---
> drivers/net/veth.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> Index: net-2.6.24/drivers/net/veth.c
> ===================================================================
> --- net-2.6.24.orig/drivers/net/veth.c
> +++ net-2.6.24/drivers/net/veth.c
> @@ -286,7 +286,6 @@ static void veth_setup(struct net_device
> dev->features |= NETIF_F_LLTX;
> dev->init = veth_dev_init;
> dev->destructor = veth_dev_free;
> - netif_carrier_off(dev);
> }
>
> /*
> @@ -357,6 +356,8 @@ static int veth_newlink(struct net_devic
> if (err < 0)
> goto err_register_peer;
>
> + netif_carrier_off(peer);
> +
> /*
> * register dev last
> *
> @@ -382,6 +383,8 @@ static int veth_newlink(struct net_devic
> if (err < 0)
> goto err_register_dev;
>
> + netif_carrier_off(dev);
> +
> /*
> * tie the deviced together
> */
>
> --
_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
More information about the Devel
mailing list