aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/cxgb/cxgb_sge.c
diff options
context:
space:
mode:
authorNavdeep Parhar <np@FreeBSD.org>2012-10-25 18:11:04 +0000
committerNavdeep Parhar <np@FreeBSD.org>2012-10-25 18:11:04 +0000
commitfef542fe1cf6c294331ae8ff0bf07e8ba6f92262 (patch)
treef01ee1596c4ab28ad8bd0431bc333d4b5c6501b2 /sys/dev/cxgb/cxgb_sge.c
parent022a7377d0f5097f275816eb29f3e70a78efbde0 (diff)
downloadsrc-fef542fe1cf6c294331ae8ff0bf07e8ba6f92262.tar.gz
src-fef542fe1cf6c294331ae8ff0bf07e8ba6f92262.zip
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
Notes
Notes: svn path=/head/; revision=242087
Diffstat (limited to 'sys/dev/cxgb/cxgb_sge.c')
-rw-r--r--sys/dev/cxgb/cxgb_sge.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/cxgb/cxgb_sge.c b/sys/dev/cxgb/cxgb_sge.c
index 08d9dc4e1362..0108339ffd56 100644
--- a/sys/dev/cxgb/cxgb_sge.c
+++ b/sys/dev/cxgb/cxgb_sge.c
@@ -2473,6 +2473,10 @@ t3_sge_alloc_qset(adapter_t *sc, u_int id, int nports, int irq_vec_idx,
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 id, int nports, int irq_vec_idx,
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);