Author: davidcs
Date: Tue Jun 30 20:17:38 2015
New Revision: 284975
URL: https://svnweb.freebsd.org/changeset/base/284975

Log:
  MFC r284739
  tx_mtx should be grabbed before calling buf_ring_dequeue_sc()
  
  Submitted by:attilio....@isilon.com

Modified:
  stable/9/sys/dev/bxe/bxe.c
Directory Properties:
  stable/9/   (props changed)
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/bxe/bxe.c
==============================================================================
--- stable/9/sys/dev/bxe/bxe.c  Tue Jun 30 20:11:48 2015        (r284974)
+++ stable/9/sys/dev/bxe/bxe.c  Tue Jun 30 20:17:38 2015        (r284975)
@@ -6562,10 +6562,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;
_______________________________________________
svn-src-stable-9@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-stable-9
To unsubscribe, send any mail to "svn-src-stable-9-unsubscr...@freebsd.org"

Reply via email to