diff options
author | glebius <glebius@FreeBSD.org> | 2005-11-30 12:37:07 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2005-11-30 12:37:07 +0000 |
commit | 1881f96934c833d378d23644b68c26b4bbeebf8d (patch) | |
tree | 5333f6d271040dd686a9be5d38f5b0a8f4a7ae30 /sys | |
parent | cf13c1efb2f55b14e928e5282e34d8249a2c1f99 (diff) | |
download | FreeBSD-src-1881f96934c833d378d23644b68c26b4bbeebf8d.zip FreeBSD-src-1881f96934c833d378d23644b68c26b4bbeebf8d.tar.gz |
If bus_dmamap_load() failed, we free the mbuf. We also need to clear
the pointer, to avoid double free on next bge_stop().
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/bge/if_bge.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c index f7ce220..bfbcb4e 100644 --- a/sys/dev/bge/if_bge.c +++ b/sys/dev/bge/if_bge.c @@ -937,8 +937,10 @@ bge_newbuf_std(sc, i, m) sc->bge_cdata.bge_rx_std_dmamap[i], mtod(m_new, void *), m_new->m_len, bge_dma_map_addr, &ctx, BUS_DMA_NOWAIT); if (error || ctx.bge_maxsegs == 0) { - if (m == NULL) + if (m == NULL) { + sc->bge_cdata.bge_rx_std_chain[i] = NULL; m_freem(m_new); + } return(ENOMEM); } r->bge_addr.bge_addr_lo = htole32(BGE_ADDR_LO(ctx.bge_busaddr)); @@ -1009,8 +1011,10 @@ bge_newbuf_jumbo(sc, i, m) sc->bge_cdata.bge_rx_jumbo_dmamap[i], mtod(m_new, void *), m_new->m_len, bge_dma_map_addr, &ctx, BUS_DMA_NOWAIT); if (error || ctx.bge_maxsegs == 0) { - if (m == NULL) + if (m == NULL) { + sc->bge_cdata.bge_rx_jumbo_chain[i] = NULL; m_freem(m_new); + } return(ENOMEM); } r->bge_addr.bge_addr_lo = htole32(BGE_ADDR_LO(ctx.bge_busaddr)); |