Skip to content

Commit

Permalink
jazzsonic: free irq if sonic_open() fails
Browse files Browse the repository at this point in the history
jazzsonic_open() doesn't check sonic_open() return code. If it is error
we must free requested IRQ.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Kulikov Vasiliy authored and David S. Miller committed Jul 13, 2010
1 parent 84ce981 commit 62cd69a
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions drivers/net/jazzsonic.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,20 @@ static unsigned short known_revisions[] =

static int jazzsonic_open(struct net_device* dev)
{
if (request_irq(dev->irq, sonic_interrupt, IRQF_DISABLED, "sonic", dev)) {
printk(KERN_ERR "%s: unable to get IRQ %d.\n", dev->name, dev->irq);
return -EAGAIN;
int retval;

retval = request_irq(dev->irq, sonic_interrupt, IRQF_DISABLED,
"sonic", dev);
if (retval) {
printk(KERN_ERR "%s: unable to get IRQ %d.\n",
dev->name, dev->irq);
return retval;
}
return sonic_open(dev);

retval = sonic_open(dev);
if (retval)
free_irq(dev->irq, dev);
return retval;
}

static int jazzsonic_close(struct net_device* dev)
Expand Down

0 comments on commit 62cd69a

Please sign in to comment.