Commit dbe000ed authored by Kulikov Vasiliy's avatar Kulikov Vasiliy Committed by David S. Miller

xtsonic: free irq if sonic_open() fails

xtsonic_open() doesn't check sonic_open() return code. If it is error
we must free requested IRQ.
Signed-off-by: default avatarKulikov Vasiliy <segooon@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 546e3abd
......@@ -93,12 +93,20 @@ static unsigned short known_revisions[] =
static int xtsonic_open(struct net_device *dev)
{
if (request_irq(dev->irq,sonic_interrupt,IRQF_DISABLED,"sonic",dev)) {
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 -EAGAIN;
}
return sonic_open(dev);
retval = sonic_open(dev);
if (retval)
free_irq(dev->irq, dev);
return retval;
}
static int xtsonic_close(struct net_device *dev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment