summaryrefslogtreecommitdiffstats
path: root/sys/i4b/layer1/isic
diff options
context:
space:
mode:
authorgj <gj@FreeBSD.org>2001-12-30 09:27:28 +0000
committergj <gj@FreeBSD.org>2001-12-30 09:27:28 +0000
commit3b3e08589b03552b648f4950664eb7822534a8fa (patch)
tree9165e9b336cd095a979269760b6936b342271161 /sys/i4b/layer1/isic
parent63f2243d7991b37afaf5ce4bcaebc637bc140d17 (diff)
downloadFreeBSD-src-3b3e08589b03552b648f4950664eb7822534a8fa.zip
FreeBSD-src-3b3e08589b03552b648f4950664eb7822534a8fa.tar.gz
Protect mtx_init() invocations with mtx_intialized() checks to avoid a
reported panic. Submitted by: Alexander Leidinger <Alexander@Leidinger.net> (partly) MFC after: 4 weeks
Diffstat (limited to 'sys/i4b/layer1/isic')
-rw-r--r--sys/i4b/layer1/isic/i4b_bchan.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/i4b/layer1/isic/i4b_bchan.c b/sys/i4b/layer1/isic/i4b_bchan.c
index 1226c17..2f520d8 100644
--- a/sys/i4b/layer1/isic/i4b_bchan.c
+++ b/sys/i4b/layer1/isic/i4b_bchan.c
@@ -90,7 +90,8 @@ isic_bchannel_setup(int unit, int h_chan, int bprot, int activate)
chan->rx_queue.ifq_maxlen = IFQ_MAXLEN;
#if defined (__FreeBSD__) && __FreeBSD__ > 4
- mtx_init(&chan->rx_queue.ifq_mtx, "i4b_isic_rx", MTX_DEF);
+ if(!mtx_initialized(&chan->rx_queue.ifq_mtx))
+ mtx_init(&chan->rx_queue.ifq_mtx, "i4b_isic_rx", MTX_DEF);
#endif
i4b_Bcleanifq(&chan->rx_queue); /* clean rx queue */
@@ -108,7 +109,8 @@ isic_bchannel_setup(int unit, int h_chan, int bprot, int activate)
chan->tx_queue.ifq_maxlen = IFQ_MAXLEN;
#if defined (__FreeBSD__) && __FreeBSD__ > 4
- mtx_init(&chan->tx_queue.ifq_mtx, "i4b_isic_tx", MTX_DEF);
+ if(!mtx_initialized(&chan->tx_queue.ifq_mtx))
+ mtx_init(&chan->tx_queue.ifq_mtx, "i4b_isic_tx", MTX_DEF);
#endif
i4b_Bcleanifq(&chan->tx_queue); /* clean tx queue */
OpenPOWER on IntegriCloud