aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/cs89x0.c
diff options
context:
space:
mode:
authorWang Chen <wangchen@cn.fujitsu.com>2008-05-30 11:18:55 +0800
committerJeff Garzik <jgarzik@redhat.com>2008-05-30 22:07:11 -0400
commit17a9440f7deb781935c76e2e55d376a35611a6f9 (patch)
tree1581e8f3ec1ac6b1c248f0c4dc3c5b002fb02717 /drivers/net/cs89x0.c
parentb055629eaef7758b35dc91c76cf4f158025562bf (diff)
[netdrvr] CS89X0: Add cleanup for dma after fail
After request_dma() succeeding, any error path should do free_dma(). Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/cs89x0.c')
-rw-r--r--drivers/net/cs89x0.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/net/cs89x0.c b/drivers/net/cs89x0.c
index 348371fda59..fba87abe78e 100644
--- a/drivers/net/cs89x0.c
+++ b/drivers/net/cs89x0.c
@@ -1394,7 +1394,11 @@ net_open(struct net_device *dev)
#endif
if (!result) {
printk(KERN_ERR "%s: EEPROM is configured for unavailable media\n", dev->name);
- release_irq:
+release_dma:
+#if ALLOW_DMA
+ free_dma(dev->dma);
+#endif
+release_irq:
#if ALLOW_DMA
release_dma_buff(lp);
#endif
@@ -1442,12 +1446,12 @@ net_open(struct net_device *dev)
if ((result = detect_bnc(dev)) != DETECTED_NONE)
break;
printk(KERN_ERR "%s: no media detected\n", dev->name);
- goto release_irq;
+ goto release_dma;
}
switch(result) {
case DETECTED_NONE:
printk(KERN_ERR "%s: no network cable attached to configured media\n", dev->name);
- goto release_irq;
+ goto release_dma;
case DETECTED_RJ45H:
printk(KERN_INFO "%s: using half-duplex 10Base-T (RJ-45)\n", dev->name);
break;