summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authordavidcs <davidcs@FreeBSD.org>2015-06-30 18:58:33 +0000
committerdavidcs <davidcs@FreeBSD.org>2015-06-30 18:58:33 +0000
commit3be46b6bd7acce511c2c81fa6fa4009da0eeb005 (patch)
tree849354f2fc8e86e1b509ca7d3cd34cc7407125aa /sys
parent9a7cb4f2b0fb340d61793d7c836d1ca87c75b384 (diff)
downloadFreeBSD-src-3be46b6bd7acce511c2c81fa6fa4009da0eeb005.zip
FreeBSD-src-3be46b6bd7acce511c2c81fa6fa4009da0eeb005.tar.gz
MFC r284739
tx_mtx should be grabbed before calling buf_ring_dequeue_sc() Submitted by:Attilio.Rao@isilon.com
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/bxe/bxe.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/dev/bxe/bxe.c b/sys/dev/bxe/bxe.c
index 22ea235..6efbfe9 100644
--- a/sys/dev/bxe/bxe.c
+++ b/sys/dev/bxe/bxe.c
@@ -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) {
- m_freem(m);
+ 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;
OpenPOWER on IntegriCloud