From 3b3e08589b03552b648f4950664eb7822534a8fa Mon Sep 17 00:00:00 2001 From: gj Date: Sun, 30 Dec 2001 09:27:28 +0000 Subject: Protect mtx_init() invocations with mtx_intialized() checks to avoid a reported panic. Submitted by: Alexander Leidinger (partly) MFC after: 4 weeks --- sys/i4b/layer1/ifpi/i4b_ifpi_pci.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'sys/i4b/layer1/ifpi') diff --git a/sys/i4b/layer1/ifpi/i4b_ifpi_pci.c b/sys/i4b/layer1/ifpi/i4b_ifpi_pci.c index 9244bda..d072b9c 100644 --- a/sys/i4b/layer1/ifpi/i4b_ifpi_pci.c +++ b/sys/i4b/layer1/ifpi/i4b_ifpi_pci.c @@ -651,11 +651,15 @@ avma1pp_attach_avma1pp(device_t dev) #if defined (__FreeBSD__) && __FreeBSD__ > 4 /* Init the channel mutexes */ chan = &sc->sc_chan[HSCX_CH_A]; - mtx_init(&chan->rx_queue.ifq_mtx, "i4b_avma1pp_rx", MTX_DEF); - mtx_init(&chan->tx_queue.ifq_mtx, "i4b_avma1pp_tx", MTX_DEF); + if(!mtx_initialized(&chan->rx_queue.ifq_mtx)) + mtx_init(&chan->rx_queue.ifq_mtx, "i4b_avma1pp_rx", MTX_DEF); + if(!mtx_initialized(&chan->tx_queue.ifq_mtx)) + mtx_init(&chan->tx_queue.ifq_mtx, "i4b_avma1pp_tx", MTX_DEF); chan = &sc->sc_chan[HSCX_CH_B]; - mtx_init(&chan->rx_queue.ifq_mtx, "i4b_avma1pp_rx", MTX_DEF); - mtx_init(&chan->tx_queue.ifq_mtx, "i4b_avma1pp_tx", MTX_DEF); + if(!mtx_initialized(&chan->rx_queue.ifq_mtx)) + mtx_init(&chan->rx_queue.ifq_mtx, "i4b_avma1pp_rx", MTX_DEF); + if(!mtx_initialized(&chan->tx_queue.ifq_mtx)) + mtx_init(&chan->tx_queue.ifq_mtx, "i4b_avma1pp_tx", MTX_DEF); #endif /* init the "HSCX" */ -- cgit v1.1