Skip to contentSkip to conversation

Fix freeing of net device

DECLANCE Ralf Baechle 1 participant 1 message Jun 30, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Plus optical sugar.

drivers/net/declance.c +4 -3
index d3d958e..92116c2 100644
@@ -704,8 +704,8 @@ static irqreturn_t lance_dma_merr_int(co
 	return IRQ_HANDLED;
 }
 
-static irqreturn_t
-lance_interrupt(const int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t lance_interrupt(const int irq, void *dev_id,
+				   struct pt_regs *regs)
 {
 	struct net_device *dev = (struct net_device *) dev_id;
 	struct lance_private *lp = netdev_priv(dev);
@@ -1254,7 +1254,7 @@ #endif
 	return 0;
 
 err_out_free_dev:
-	kfree(dev);
+	free_netdev(dev);
 
 err_out:
 	return ret;
@@ -1300,6 +1300,7 @@ static void __exit dec_lance_cleanup(voi
 	while (root_lance_dev) {
 		struct net_device *dev = root_lance_dev;
 		struct lance_private *lp = netdev_priv(dev);
+
 		unregister_netdev(dev);
 #ifdef CONFIG_TC
 		if (lp->slot >= 0)