MFC r284739

tx_mtx should be grabbed before calling buf_ring_dequeue_sc()

Submitted by:Attilio.Rao@isilon.com
This commit is contained in:
davidcs 2015-06-30 18:58:33 +00:00
parent 9a7cb4f2b0
commit 3be46b6bd7

View File

@ -6553,10 +6553,14 @@ bxe_free_fp_buffers(struct bxe_softc *sc)
#if __FreeBSD_version >= 800000
if (fp->tx_br != NULL) {
struct mbuf *m;
/* just in case bxe_mq_flush() wasn't called */
while ((m = buf_ring_dequeue_sc(fp->tx_br)) != NULL) {
if (mtx_initialized(&fp->tx_mtx)) {
struct mbuf *m;
BXE_FP_TX_LOCK(fp);
while ((m = buf_ring_dequeue_sc(fp->tx_br)) != NULL)
m_freem(m);
BXE_FP_TX_UNLOCK(fp);
}
buf_ring_free(fp->tx_br, M_DEVBUF);
fp->tx_br = NULL;