From owner-svn-src-all@FreeBSD.ORG Tue Jun 23 20:09:53 2015 Return-Path: Delivered-To: svn-src-all@nevdull.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 81378F8E; Tue, 23 Jun 2015 20:09:53 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6FA7ECB7; Tue, 23 Jun 2015 20:09:53 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5NK9rhL034643; Tue, 23 Jun 2015 20:09:53 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5NK9rmL034642; Tue, 23 Jun 2015 20:09:53 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201506232009.t5NK9rmL034642@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Tue, 23 Jun 2015 20:09:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284739 - head/sys/dev/bxe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jun 2015 20:09:53 -0000 Author: davidcs Date: Tue Jun 23 20:09:52 2015 New Revision: 284739 URL: https://svnweb.freebsd.org/changeset/base/284739 Log: tx_mtx should be grabbed before calling buf_ring_dequeue_sc() Submitted by:Attilio.Rao@isilon.com MFC after:5 days Modified: head/sys/dev/bxe/bxe.c Modified: head/sys/dev/bxe/bxe.c ============================================================================== --- head/sys/dev/bxe/bxe.c Tue Jun 23 20:01:12 2015 (r284738) +++ head/sys/dev/bxe/bxe.c Tue Jun 23 20:09:52 2015 (r284739) @@ -6547,10 +6547,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;