Author: arybchik
Date: Wed Mar 25 10:20:42 2015
New Revision: 280516
URL: https://svnweb.freebsd.org/changeset/base/280516

Log:
  MFC: 277892
  
  sfxge: Pass correct address to free allocated memory in the case of load error
  
  Most likely is was just memory leak on the error handling path since
  typically efsys_mem_t is filled in by zeros on allocation.
  
  Sponsored by:   Solarflare Communications, Inc.
  Approved by:    gnn (mentor)

Modified:
  stable/10/sys/dev/sfxge/sfxge_dma.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/sfxge_dma.c
==============================================================================
--- stable/10/sys/dev/sfxge/sfxge_dma.c Wed Mar 25 10:19:43 2015        
(r280515)
+++ stable/10/sys/dev/sfxge/sfxge_dma.c Wed Mar 25 10:20:42 2015        
(r280516)
@@ -153,7 +153,7 @@ sfxge_dma_alloc(struct sfxge_softc *sc, 
        if (bus_dmamap_load(esmp->esm_tag, esmp->esm_map, vaddr, len,
            sfxge_dma_cb, &esmp->esm_addr, 0) != 0) {
                device_printf(sc->dev, "Couldn't load DMA mapping\n");
-               bus_dmamem_free(esmp->esm_tag, esmp->esm_base, esmp->esm_map);
+               bus_dmamem_free(esmp->esm_tag, vaddr, esmp->esm_map);
                bus_dma_tag_destroy(esmp->esm_tag);
                return (ENOMEM);
        }
_______________________________________________
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