diff options
author | arybchik <arybchik@FreeBSD.org> | 2015-03-25 10:20:42 +0000 |
---|---|---|
committer | arybchik <arybchik@FreeBSD.org> | 2015-03-25 10:20:42 +0000 |
commit | 1cdbe3b725bb98b1dccb33f75904bb069a86ac49 (patch) | |
tree | c67269bb7106ed30e4fc91d581617fe081a0a5b9 | |
parent | 1452f96d59a3c473931f47ef1002cc1bc5b64f97 (diff) | |
download | FreeBSD-src-1cdbe3b725bb98b1dccb33f75904bb069a86ac49.zip FreeBSD-src-1cdbe3b725bb98b1dccb33f75904bb069a86ac49.tar.gz |
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)
-rw-r--r-- | sys/dev/sfxge/sfxge_dma.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/sfxge/sfxge_dma.c b/sys/dev/sfxge/sfxge_dma.c index d98e5b5..6030a89 100644 --- a/sys/dev/sfxge/sfxge_dma.c +++ b/sys/dev/sfxge/sfxge_dma.c @@ -153,7 +153,7 @@ sfxge_dma_alloc(struct sfxge_softc *sc, bus_size_t len, efsys_mem_t *esmp) 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); } |