Date: Tue, 30 Jun 2015 20:31:01 +0000 (UTC) From: David C Somayajulu <davidcs@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r284978 - stable/8/sys/dev/bxe Message-ID: <201506302031.t5UKV1FQ009746@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: davidcs Date: Tue Jun 30 20:31:00 2015 New Revision: 284978 URL: https://svnweb.freebsd.org/changeset/base/284978 Log: MFC r284739 tx_mtx should be grabbed before calling buf_ring_dequeue_sc() Submitted by: Attilio.Rao@isilon.com Modified: stable/8/sys/dev/bxe/bxe.c Directory Properties: stable/8/ (props changed) stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) Modified: stable/8/sys/dev/bxe/bxe.c ============================================================================== --- stable/8/sys/dev/bxe/bxe.c Tue Jun 30 20:28:07 2015 (r284977) +++ stable/8/sys/dev/bxe/bxe.c Tue Jun 30 20:31:00 2015 (r284978) @@ -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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201506302031.t5UKV1FQ009746>