Subject: [DECLANCE] Fix freeing of net device

From: Ralf Baechle <[email-masked]>
Date: Fri, 30 Jun 2006 13:56:13 +0100

Plus optical sugar.

Signed-off-by: Ralf Baechle <[email-masked]>

diff --git a/drivers/net/declance.c b/drivers/net/declance.c
index d3d958e..92116c2 100644
--- a/drivers/net/declance.c
+++ b/drivers/net/declance.c
@@ -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)