diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2002-05-13 14:19:54 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2002-05-13 14:19:54 +0000 |
commit | fbdddc7f29c724f9a084c2e713ea00846e7f2a92 (patch) | |
tree | f01acb90625f1c0d2f2c87377eb038ecbdd6aa78 /sys/dev | |
parent | b1018160c2889f54d5fce2fe5c002083a7e4b306 (diff) |
Don't leak memory when bus_dmamap_load_mbuf fails.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ic/fxp.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/ic/fxp.c b/sys/dev/ic/fxp.c index 25acb0e4603..37acd74f752 100644 --- a/sys/dev/ic/fxp.c +++ b/sys/dev/ic/fxp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fxp.c,v 1.35 2002/05/10 15:54:03 art Exp $ */ +/* $OpenBSD: fxp.c,v 1.36 2002/05/13 14:19:53 art Exp $ */ /* $NetBSD: if_fxp.c,v 1.2 1997/06/05 02:01:55 thorpej Exp $ */ /* @@ -659,8 +659,10 @@ fxp_start(ifp) m_copydata(m0, 0, m0->m_pkthdr.len, mtod(m, caddr_t)); m->m_pkthdr.len = m->m_len = m0->m_pkthdr.len; if (bus_dmamap_load_mbuf(sc->sc_dmat, txs->tx_map, - m, BUS_DMA_NOWAIT) != 0) + m, BUS_DMA_NOWAIT) != 0) { + m_freem(m); break; + } } IFQ_DEQUEUE(&ifp->if_snd, m0); |