Commit 8757d0fc authored by Mitchell Horne's avatar Mitchell Horne
Browse files

if_ffec: free the dmamem allocation in detach

Calling bus_dmamap_destroy() for a mapping which was allocated with
bus_dmamem_alloc() will result in a panic. This change is not run-time
tested, but I identified the issue while implementing the analogous
method in if_dwc(4), using this implementation as the template.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
parent b93985c1
......@@ -1425,7 +1425,8 @@ ffec_detach(device_t dev)
if (sc->rxdesc_map != NULL) {
bus_dmamap_unload(sc->rxdesc_tag, sc->rxdesc_map);
bus_dmamap_destroy(sc->rxdesc_tag, sc->rxdesc_map);
bus_dmamem_free(sc->rxdesc_tag, sc->rxdesc_ring,
if (sc->rxdesc_tag != NULL)
......@@ -1441,7 +1442,8 @@ ffec_detach(device_t dev)
if (sc->txdesc_map != NULL) {
bus_dmamap_unload(sc->txdesc_tag, sc->txdesc_map);
bus_dmamap_destroy(sc->txdesc_tag, sc->txdesc_map);
bus_dmamem_free(sc->txdesc_tag, sc->txdesc_ring,
if (sc->txdesc_tag != NULL)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment