diff options
author | Kulikov Vasiliy <segooon@gmail.com> | 2010-07-09 21:01:44 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-07-12 23:21:45 -0400 |
commit | dbe000ed3f3033e8e6321d79023c827faf649c4d (patch) | |
tree | 324eb7512d9a72d2b5c372e78851b814fc6e0568 /drivers/net/xtsonic.c | |
parent | 546e3abde391ef01ef4690e941611654343ea0bf (diff) |
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: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/xtsonic.c')
-rw-r--r-- | drivers/net/xtsonic.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/net/xtsonic.c b/drivers/net/xtsonic.c index fdba9cb3a599..9f12026d98e7 100644 --- a/drivers/net/xtsonic.c +++ b/drivers/net/xtsonic.c | |||
@@ -93,12 +93,20 @@ static unsigned short known_revisions[] = | |||
93 | 93 | ||
94 | static int xtsonic_open(struct net_device *dev) | 94 | static int xtsonic_open(struct net_device *dev) |
95 | { | 95 | { |
96 | if (request_irq(dev->irq,sonic_interrupt,IRQF_DISABLED,"sonic",dev)) { | 96 | int retval; |
97 | |||
98 | retval = request_irq(dev->irq, sonic_interrupt, IRQF_DISABLED, | ||
99 | "sonic", dev); | ||
100 | if (retval) { | ||
97 | printk(KERN_ERR "%s: unable to get IRQ %d.\n", | 101 | printk(KERN_ERR "%s: unable to get IRQ %d.\n", |
98 | dev->name, dev->irq); | 102 | dev->name, dev->irq); |
99 | return -EAGAIN; | 103 | return -EAGAIN; |
100 | } | 104 | } |
101 | return sonic_open(dev); | 105 | |
106 | retval = sonic_open(dev); | ||
107 | if (retval) | ||
108 | free_irq(dev->irq, dev); | ||
109 | return retval; | ||
102 | } | 110 | } |
103 | 111 | ||
104 | static int xtsonic_close(struct net_device *dev) | 112 | static int xtsonic_close(struct net_device *dev) |