Skip to content

Commit

Permalink
[netdrvr] CS89X0: Add cleanup for dma after fail
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wang Chen authored and Jeff Garzik committed May 31, 2008
1 parent b055629 commit 17a9440
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions drivers/net/cs89x0.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 17a9440

Please sign in to comment.