提交 62cd69a1 编写于 作者: K Kulikov Vasiliy 提交者: David S. Miller

jazzsonic: free irq if sonic_open() fails

jazzsonic_open() doesn't check sonic_open() return code. If it is error
we must free requested IRQ.
Signed-off-by: NKulikov Vasiliy <segooon@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 84ce981a
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册