1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-21 11:13:30 +00:00

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:
Andrew Rybchenko 2015-02-22 18:50:59 +00:00
parent d9ff48ab2c
commit 1a4bd60bf9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=279176

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