diff options
author | Kulikov Vasiliy <segooon@gmail.com> | 2010-07-09 21:00:35 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-07-12 23:21:44 -0400 |
commit | 62cd69a10683bd17a2454213b8c36a4399c533ab (patch) | |
tree | 96695bebd1163f6ebf6553c931c5bacc3dc35e90 /drivers/net/jazzsonic.c | |
parent | 84ce981a076c6b2d3efec66bf92a91d1aa80c983 (diff) |
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: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/jazzsonic.c')
-rw-r--r-- | drivers/net/jazzsonic.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/net/jazzsonic.c b/drivers/net/jazzsonic.c index 3e6aaf9e5ce7..949c1f933644 100644 --- a/drivers/net/jazzsonic.c +++ b/drivers/net/jazzsonic.c | |||
@@ -82,11 +82,20 @@ static unsigned short known_revisions[] = | |||
82 | 82 | ||
83 | static int jazzsonic_open(struct net_device* dev) | 83 | static int jazzsonic_open(struct net_device* dev) |
84 | { | 84 | { |
85 | if (request_irq(dev->irq, sonic_interrupt, IRQF_DISABLED, "sonic", dev)) { | 85 | int retval; |
86 | printk(KERN_ERR "%s: unable to get IRQ %d.\n", dev->name, dev->irq); | 86 | |
87 | return -EAGAIN; | 87 | retval = request_irq(dev->irq, sonic_interrupt, IRQF_DISABLED, |
88 | "sonic", dev); | ||
89 | if (retval) { | ||
90 | printk(KERN_ERR "%s: unable to get IRQ %d.\n", | ||
91 | dev->name, dev->irq); | ||
92 | return retval; | ||
88 | } | 93 | } |
89 | return sonic_open(dev); | 94 | |
95 | retval = sonic_open(dev); | ||
96 | if (retval) | ||
97 | free_irq(dev->irq, dev); | ||
98 | return retval; | ||
90 | } | 99 | } |
91 | 100 | ||
92 | static int jazzsonic_close(struct net_device* dev) | 101 | static int jazzsonic_close(struct net_device* dev) |