mirror of
https://github.com/opnsense/src.git
synced 2026-04-15 14:29:58 -04:00
Fix use-after-free for DMA tag. Destroy DMA tag later.
Submitted by: Yuriy Tsibizov
This commit is contained in:
parent
7a92401aea
commit
53bc1d83c0
1 changed files with 4 additions and 3 deletions
|
|
@ -2614,9 +2614,6 @@ emu_uninit(struct emu_sc_info *sc)
|
|||
emu_wrptr(sc, 0, SOLEL, 0);
|
||||
emu_wrptr(sc, 0, SOLEH, 0);
|
||||
|
||||
if (sc->mem.dmat)
|
||||
bus_dma_tag_destroy(sc->mem.dmat);
|
||||
|
||||
if (!SLIST_EMPTY(&sc->mem.blocks))
|
||||
device_printf(sc->dev, "warning: memblock list not empty\n");
|
||||
|
||||
|
|
@ -3103,6 +3100,10 @@ emu_pci_detach(device_t dev)
|
|||
if (r)
|
||||
return (r);
|
||||
emu_rm_uninit(sc);
|
||||
|
||||
if (sc->mem.dmat)
|
||||
bus_dma_tag_destroy(sc->mem.dmat);
|
||||
|
||||
if (sc->reg)
|
||||
bus_release_resource(dev, SYS_RES_IOPORT, PCIR_BAR(0), sc->reg);
|
||||
bus_teardown_intr(dev, sc->irq, sc->ih);
|
||||
|
|
|
|||
Loading…
Reference in a new issue