Commit 17a9440f authored by Wang Chen's avatar Wang Chen Committed by Jeff Garzik

[netdrvr] CS89X0: Add cleanup for dma after fail

After request_dma() succeeding, any error path should do free_dma().
Signed-off-by: default avatarWang Chen <wangchen@cn.fujitsu.com>
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent b055629e
...@@ -1394,7 +1394,11 @@ net_open(struct net_device *dev) ...@@ -1394,7 +1394,11 @@ net_open(struct net_device *dev)
#endif #endif
if (!result) { if (!result) {
printk(KERN_ERR "%s: EEPROM is configured for unavailable media\n", dev->name); 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 #if ALLOW_DMA
release_dma_buff(lp); release_dma_buff(lp);
#endif #endif
...@@ -1442,12 +1446,12 @@ net_open(struct net_device *dev) ...@@ -1442,12 +1446,12 @@ net_open(struct net_device *dev)
if ((result = detect_bnc(dev)) != DETECTED_NONE) if ((result = detect_bnc(dev)) != DETECTED_NONE)
break; break;
printk(KERN_ERR "%s: no media detected\n", dev->name); printk(KERN_ERR "%s: no media detected\n", dev->name);
goto release_irq; goto release_dma;
} }
switch(result) { switch(result) {
case DETECTED_NONE: case DETECTED_NONE:
printk(KERN_ERR "%s: no network cable attached to configured media\n", dev->name); printk(KERN_ERR "%s: no network cable attached to configured media\n", dev->name);
goto release_irq; goto release_dma;
case DETECTED_RJ45H: case DETECTED_RJ45H:
printk(KERN_INFO "%s: using half-duplex 10Base-T (RJ-45)\n", dev->name); printk(KERN_INFO "%s: using half-duplex 10Base-T (RJ-45)\n", dev->name);
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment