Skip to content

Commit

Permalink
de2104x: prevent interrupt before the interrupt handler is registered
Browse files Browse the repository at this point in the history
de_init_hw enables the irq thus it must be issued after request_irq.

Signed-off-by: Martin Michlmayr <tbm@cyrius.com>
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
  • Loading branch information
Francois Romieu authored and Romieu Francois committed Mar 9, 2006
1 parent 6218cf4 commit 3f735b7
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions drivers/net/tulip/de2104x.c
Original file line number Diff line number Diff line change
Expand Up @@ -1362,7 +1362,6 @@ static int de_open (struct net_device *dev)
{
struct de_private *de = dev->priv;
int rc;
unsigned long flags;

if (netif_msg_ifup(de))
printk(KERN_DEBUG "%s: enabling interface\n", dev->name);
Expand All @@ -1376,30 +1375,29 @@ static int de_open (struct net_device *dev)
return rc;
}

rc = de_init_hw(de);
if (rc) {
printk(KERN_ERR "%s: h/w init failure, err=%d\n",
dev->name, rc);
goto err_out_free;
}
dw32(IntrMask, 0);

rc = request_irq(dev->irq, de_interrupt, SA_SHIRQ, dev->name, dev);
if (rc) {
printk(KERN_ERR "%s: IRQ %d request failure, err=%d\n",
dev->name, dev->irq, rc);
goto err_out_hw;
goto err_out_free;
}

rc = de_init_hw(de);
if (rc) {
printk(KERN_ERR "%s: h/w init failure, err=%d\n",
dev->name, rc);
goto err_out_free_irq;
}

netif_start_queue(dev);
mod_timer(&de->media_timer, jiffies + DE_TIMER_NO_LINK);

return 0;

err_out_hw:
spin_lock_irqsave(&de->lock, flags);
de_stop_hw(de);
spin_unlock_irqrestore(&de->lock, flags);

err_out_free_irq:
free_irq(dev->irq, dev);
err_out_free:
de_free_rings(de);
return rc;
Expand Down

0 comments on commit 3f735b7

Please sign in to comment.