Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Oct 2012 18:11:05 +0000 (UTC)
From:      Navdeep Parhar <np@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r242087 - head/sys/dev/cxgb
Message-ID:  <201210251811.q9PIB5gp016863@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: np
Date: Thu Oct 25 18:11:04 2012
New Revision: 242087
URL: http://svn.freebsd.org/changeset/base/242087

Log:
  Initialize the response queue mutex a bit earlier to avoid a panic that
  occurs if t3_sge_alloc_qset fails and then t3_free_qset attempts to
  destroy an uninitialized mutex.
  
  Submitted by:	Vijay Singh <vijju dot singh at gmail>
  MFC after:	3 days

Modified:
  head/sys/dev/cxgb/cxgb_sge.c

Modified: head/sys/dev/cxgb/cxgb_sge.c
==============================================================================
--- head/sys/dev/cxgb/cxgb_sge.c	Thu Oct 25 17:29:11 2012	(r242086)
+++ head/sys/dev/cxgb/cxgb_sge.c	Thu Oct 25 18:11:04 2012	(r242087)
@@ -2473,6 +2473,10 @@ t3_sge_alloc_qset(adapter_t *sc, u_int i
 		goto err;
 	}
 
+	snprintf(q->rspq.lockbuf, RSPQ_NAME_LEN, "t3 rspq lock %d:%d",
+	    device_get_unit(sc->dev), irq_vec_idx);
+	MTX_INIT(&q->rspq.lock, q->rspq.lockbuf, NULL, MTX_DEF);
+
 	for (i = 0; i < ntxq; ++i) {
 		size_t sz = i == TXQ_CTRL ? 0 : sizeof(struct tx_sw_desc);
 
@@ -2590,11 +2594,7 @@ t3_sge_alloc_qset(adapter_t *sc, u_int i
 			goto err_unlock;
 		}
 	}
-	
-	snprintf(q->rspq.lockbuf, RSPQ_NAME_LEN, "t3 rspq lock %d:%d",
-	    device_get_unit(sc->dev), irq_vec_idx);
-	MTX_INIT(&q->rspq.lock, q->rspq.lockbuf, NULL, MTX_DEF);
-	
+
 	mtx_unlock_spin(&sc->sge.reg_lock);
 	t3_update_qset_coalesce(q, p);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201210251811.q9PIB5gp016863>