[netdrvr] CS89X0: Add cleanup for dma after fail
authorWang Chen <wangchen@cn.fujitsu.com>
Fri, 30 May 2008 03:18:55 +0000 (11:18 +0800)
committerJeff Garzik <jgarzik@redhat.com>
Sat, 31 May 2008 02:07:11 +0000 (22:07 -0400)
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>
drivers/net/cs89x0.c

index 348371fda597b0f1072e92cf062f11a4a12d7924..fba87abe78ee21f96b87fac12156fc1e35dead64 100644 (file)
@@ -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;