diff options
author | Damien Bergamini <damien@cvs.openbsd.org> | 2006-05-19 18:28:24 +0000 |
---|---|---|
committer | Damien Bergamini <damien@cvs.openbsd.org> | 2006-05-19 18:28:24 +0000 |
commit | a49b19f8f65ae39c7abac3a503f290736260f123 (patch) | |
tree | 197fe9eca09ef462a683064736e1cfd5734d6955 /sys | |
parent | f88c6b8ac1e6303ef8f8a3f4b258168f8bbd7d81 (diff) |
don't leak a mbuf with each scan command
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/if_wpi.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/sys/dev/pci/if_wpi.c b/sys/dev/pci/if_wpi.c index 41303e311b4..e3d2982f235 100644 --- a/sys/dev/pci/if_wpi.c +++ b/sys/dev/pci/if_wpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_wpi.c,v 1.5 2006/05/19 18:24:08 damien Exp $ */ +/* $OpenBSD: if_wpi.c,v 1.6 2006/05/19 18:28:23 damien Exp $ */ /*- * Copyright (c) 2006 @@ -1159,9 +1159,21 @@ wpi_tx_intr(struct wpi_softc *sc, struct wpi_rx_desc *desc, void wpi_cmd_intr(struct wpi_softc *sc, struct wpi_rx_desc *desc) { + struct wpi_tx_ring *ring = &sc->cmdq; + struct wpi_tx_data *data; + if ((desc->qid & 7) != 4) return; /* not a command ack */ + data = &ring->data[desc->idx]; + + /* if the command was mapped in a mbuf, free it */ + if (data->m != NULL) { + bus_dmamap_unload(sc->sc_dmat, data->map); + m_freem(data->m); + data->m = NULL; + } + wakeup(&sc->cmdq.cmd[desc->idx]); } |