Author: hiren
Date: Wed Apr 17 21:21:27 2013
New Revision: 249595
URL: http://svnweb.freebsd.org/changeset/base/249595

Log:
  Improving r249461 by providing a better way to handle the clang warning.
  
  PR:           kern/177164
  Reviewed by:  jhb
  Approved by:  sbruno (mentor)

Modified:
  head/sys/dev/ips/ips.c

Modified: head/sys/dev/ips/ips.c
==============================================================================
--- head/sys/dev/ips/ips.c      Wed Apr 17 21:08:18 2013        (r249594)
+++ head/sys/dev/ips/ips.c      Wed Apr 17 21:21:27 2013        (r249595)
@@ -578,7 +578,7 @@ static int ips_copperhead_queue_init(ips
 {
        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
                                &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
        
        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;
 }
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to