summaryrefslogtreecommitdiffstats
path: root/sys/dev/ips
diff options
context:
space:
mode:
authorhiren <hiren@FreeBSD.org>2013-04-17 21:21:27 +0000
committerhiren <hiren@FreeBSD.org>2013-04-17 21:21:27 +0000
commit64d828dacb80393b9972a63775bc9a9ec7c26bfd (patch)
tree56deccdcb40b4c221ab537e5929d001cf88f4d6e /sys/dev/ips
parent97374054b236803db7bf33e12feab5f66a666420 (diff)
downloadFreeBSD-src-64d828dacb80393b9972a63775bc9a9ec7c26bfd.zip
FreeBSD-src-64d828dacb80393b9972a63775bc9a9ec7c26bfd.tar.gz
Improving r249461 by providing a better way to handle the clang warning.
PR: kern/177164 Reviewed by: jhb Approved by: sbruno (mentor)
Diffstat (limited to 'sys/dev/ips')
-rw-r--r--sys/dev/ips/ips.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/ips/ips.c b/sys/dev/ips/ips.c
index 481dd4b..4de98ce 100644
--- a/sys/dev/ips/ips.c
+++ b/sys/dev/ips/ips.c
@@ -578,7 +578,7 @@ static int ips_copperhead_queue_init(ips_softc_t *sc)
{
int error;
bus_dma_tag_t dmatag;
- bus_dmamap_t dmamap = NULL;
+ bus_dmamap_t dmamap;
if (bus_dma_tag_create( /* parent */ sc->adapter_dmatag,
/* alignemnt */ 1,
/* boundary */ 0,
@@ -595,7 +595,7 @@ static int ips_copperhead_queue_init(ips_softc_t *sc)
&dmatag) != 0) {
device_printf(sc->dev, "can't alloc dma tag for statue queue\n");
error = ENOMEM;
- goto exit;
+ return error;
}
if(bus_dmamem_alloc(dmatag, (void *)&(sc->copper_queue),
BUS_DMA_NOWAIT, &dmamap)){
@@ -623,7 +623,8 @@ static int ips_copperhead_queue_init(ips_softc_t *sc)
return 0;
exit:
- bus_dmamem_free(dmatag, sc->copper_queue, dmamap);
+ if (sc->copper_queue != NULL)
+ bus_dmamem_free(dmatag, sc->copper_queue, dmamap);
bus_dma_tag_destroy(dmatag);
return error;
}
OpenPOWER on IntegriCloud