From: Daniel Lezcano <[EMAIL PROTECTED]>

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 <[EMAIL PROTECTED]>
---
 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
         */

-- 
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to