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
This commit is contained in:
Luigi Rizzo 2012-01-12 17:30:44 +00:00
parent 467bd5c2cb
commit ce9f43b467
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=230024

View File

@ -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 */
}
}