Later freeing of netdev.
authorFlorian Pose <fp@igh-essen.com>
Wed, 28 Oct 2009 14:59:34 +0100
changeset 1552 c9e2c3be294e
parent 1551 82a9eaba8a8b
child 1553 4e8d56d6f12a
Later freeing of netdev.
master/ethernet.c
--- a/master/ethernet.c	Wed Oct 28 14:01:23 2009 +0100
+++ b/master/ethernet.c	Wed Oct 28 14:59:34 2009 +0100
@@ -185,7 +185,6 @@
 void ec_eoe_clear(ec_eoe_t *eoe /**< EoE handler */)
 {
     unregister_netdev(eoe->dev); // possibly calls close callback
-    free_netdev(eoe->dev);
 
     // empty transmit queue
     ec_eoe_flush(eoe);
@@ -195,7 +194,10 @@
         kfree(eoe->tx_frame);
     }
 
-    if (eoe->rx_skb) dev_kfree_skb(eoe->rx_skb);
+    if (eoe->rx_skb)
+        dev_kfree_skb(eoe->rx_skb);
+
+    free_netdev(eoe->dev);
 
     ec_datagram_clear(&eoe->datagram);
 }