Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Oct 2012 19:34:45 +0000 (UTC)
From:      Navdeep Parhar <np@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r242371 - stable/7/sys/dev/cxgb
Message-ID:  <201210301934.q9UJYjdj059367@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: np
Date: Tue Oct 30 19:34:45 2012
New Revision: 242371
URL: http://svn.freebsd.org/changeset/base/242371

Log:
  MFC r242087:
  
  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.

Modified:
  stable/7/sys/dev/cxgb/cxgb_sge.c
Directory Properties:
  stable/7/sys/   (props changed)

Modified: stable/7/sys/dev/cxgb/cxgb_sge.c
==============================================================================
--- stable/7/sys/dev/cxgb/cxgb_sge.c	Tue Oct 30 19:24:05 2012	(r242370)
+++ stable/7/sys/dev/cxgb/cxgb_sge.c	Tue Oct 30 19:34:45 2012	(r242371)
@@ -2311,6 +2311,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) {
 		/*
 		 * The control queue always uses immediate data so does not
@@ -2438,11 +2442,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);
 	q->port = pi;



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