Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Jan 2015 19:04:42 +0000 (UTC)
From:      Andrew Rybchenko <arybchik@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r277892 - head/sys/dev/sfxge
Message-ID:  <201501291904.t0TJ4gla082021@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: arybchik
Date: Thu Jan 29 19:04:42 2015
New Revision: 277892
URL: https://svnweb.freebsd.org/changeset/base/277892

Log:
  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:
  head/sys/dev/sfxge/sfxge_dma.c

Modified: head/sys/dev/sfxge/sfxge_dma.c
==============================================================================
--- head/sys/dev/sfxge/sfxge_dma.c	Thu Jan 29 19:03:33 2015	(r277891)
+++ head/sys/dev/sfxge/sfxge_dma.c	Thu Jan 29 19:04:42 2015	(r277892)
@@ -157,7 +157,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);
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201501291904.t0TJ4gla082021>