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)
This commit is contained in:
arybchik 2015-02-22 18:50:59 +00:00
parent 9b1bba98df
commit a98735b36c

View File

@ -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);
}