From a98735b36c08ea49eed4eda0a6fa91d2a3b29b96 Mon Sep 17 00:00:00 2001 From: arybchik Date: Sun, 22 Feb 2015 18:50:59 +0000 Subject: [PATCH] sfxge: pass correct address to free allocated memory in the case of load error It is one more place missed in the previous fix. 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) --- sys/dev/sfxge/sfxge_dma.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/sfxge/sfxge_dma.c b/sys/dev/sfxge/sfxge_dma.c index 5800b0a07f2b..b399496b2f3e 100644 --- a/sys/dev/sfxge/sfxge_dma.c +++ b/sys/dev/sfxge/sfxge_dma.c @@ -168,8 +168,8 @@ sfxge_dma_alloc(struct sfxge_softc *sc, bus_size_t len, efsys_mem_t *esmp) * wrong. */ if (esmp->esm_addr == 0) { - bus_dmamem_free(esmp->esm_tag, esmp->esm_base, esmp->esm_map); - bus_dma_tag_destroy(esmp->esm_tag); + bus_dmamem_free(esmp->esm_tag, vaddr, esmp->esm_map); + bus_dma_tag_destroy(esmp->esm_tag); return (ENOMEM); }