[PATCH] Fix freeing of net device

Plus optical sugar.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
This commit is contained in:
Ralf Baechle 2006-06-30 13:56:13 +01:00 committed by Jeff Garzik
parent 22db99bd32
commit b07db75a9f
1 changed files with 4 additions and 3 deletions

View File

@ -703,8 +703,8 @@ static irqreturn_t lance_dma_merr_int(const int irq, void *dev_id,
return IRQ_HANDLED; return IRQ_HANDLED;
} }
static irqreturn_t static irqreturn_t lance_interrupt(const int irq, void *dev_id,
lance_interrupt(const int irq, void *dev_id, struct pt_regs *regs) struct pt_regs *regs)
{ {
struct net_device *dev = (struct net_device *) dev_id; struct net_device *dev = (struct net_device *) dev_id;
struct lance_private *lp = netdev_priv(dev); struct lance_private *lp = netdev_priv(dev);
@ -1253,7 +1253,7 @@ static int __init dec_lance_init(const int type, const int slot)
return 0; return 0;
err_out_free_dev: err_out_free_dev:
kfree(dev); free_netdev(dev);
err_out: err_out:
return ret; return ret;
@ -1299,6 +1299,7 @@ static void __exit dec_lance_cleanup(void)
while (root_lance_dev) { while (root_lance_dev) {
struct net_device *dev = root_lance_dev; struct net_device *dev = root_lance_dev;
struct lance_private *lp = netdev_priv(dev); struct lance_private *lp = netdev_priv(dev);
unregister_netdev(dev); unregister_netdev(dev);
#ifdef CONFIG_TC #ifdef CONFIG_TC
if (lp->slot >= 0) if (lp->slot >= 0)