diff options
author | luigi <luigi@FreeBSD.org> | 2012-01-12 17:30:44 +0000 |
---|---|---|
committer | luigi <luigi@FreeBSD.org> | 2012-01-12 17:30:44 +0000 |
commit | 1e5c8c891cb84cffeda3a526192d33c0161f00b4 (patch) | |
tree | 01086b05683e925d00da854fc425724a5ecfd08c /sys/dev/e1000/if_em.c | |
parent | 09bc13afdd22fbe59ef3b6db00e8958433d2b704 (diff) | |
download | FreeBSD-src-1e5c8c891cb84cffeda3a526192d33c0161f00b4.zip FreeBSD-src-1e5c8c891cb84cffeda3a526192d33c0161f00b4.tar.gz |
clear the pointer after freeing the mbuf. Without that, we
risk a double free if the subsequent mbuf allocation fails.
This bug is not netmap-related and was introduced in rev. 228387
Diffstat (limited to 'sys/dev/e1000/if_em.c')
-rw-r--r-- | sys/dev/e1000/if_em.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 0102517..95d8b9a 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -4044,6 +4044,7 @@ em_setup_receive_ring(struct rx_ring *rxr) BUS_DMASYNC_POSTREAD); bus_dmamap_unload(rxr->rxtag, rxbuf->map); m_freem(rxbuf->m_head); + rxbuf->m_head = NULL; /* mark as freed */ } } |