Commit bda2acef authored by Dave Jones's avatar Dave Jones Committed by Dave Jones

[PATCH] plug leaks in aic7xxx_osm

Spotted with the source checker from Coverity.com.
Signed-off-by: default avatarDave Jones <davej@redhat.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 506b1a3b
...@@ -1408,6 +1408,7 @@ ahc_dmamem_alloc(struct ahc_softc *ahc, bus_dma_tag_t dmat, void** vaddr, ...@@ -1408,6 +1408,7 @@ ahc_dmamem_alloc(struct ahc_softc *ahc, bus_dma_tag_t dmat, void** vaddr,
if (ahc->dev_softc != NULL) if (ahc->dev_softc != NULL)
if (ahc_pci_set_dma_mask(ahc->dev_softc, 0xFFFFFFFF)) { if (ahc_pci_set_dma_mask(ahc->dev_softc, 0xFFFFFFFF)) {
printk(KERN_WARNING "aic7xxx: No suitable DMA available.\n"); printk(KERN_WARNING "aic7xxx: No suitable DMA available.\n");
kfree(map);
return (ENODEV); return (ENODEV);
} }
*vaddr = pci_alloc_consistent(ahc->dev_softc, *vaddr = pci_alloc_consistent(ahc->dev_softc,
...@@ -1416,6 +1417,7 @@ ahc_dmamem_alloc(struct ahc_softc *ahc, bus_dma_tag_t dmat, void** vaddr, ...@@ -1416,6 +1417,7 @@ ahc_dmamem_alloc(struct ahc_softc *ahc, bus_dma_tag_t dmat, void** vaddr,
if (ahc_pci_set_dma_mask(ahc->dev_softc, if (ahc_pci_set_dma_mask(ahc->dev_softc,
ahc->platform_data->hw_dma_mask)) { ahc->platform_data->hw_dma_mask)) {
printk(KERN_WARNING "aic7xxx: No suitable DMA available.\n"); printk(KERN_WARNING "aic7xxx: No suitable DMA available.\n");
kfree(map);
return (ENODEV); return (ENODEV);
} }
#else /* LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) */ #else /* LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) */
......
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