summaryrefslogtreecommitdiffstats
path: root/sys/i4b/capi/iavc
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/capi/iavc
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/capi/iavc')
-rw-r--r--sys/i4b/capi/iavc/iavc_isa.c3
-rw-r--r--sys/i4b/capi/iavc/iavc_pci.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/sys/i4b/capi/iavc/iavc_isa.c b/sys/i4b/capi/iavc/iavc_isa.c
index 96ea1c9..b4cfaba 100644
--- a/sys/i4b/capi/iavc/iavc_isa.c
+++ b/sys/i4b/capi/iavc/iavc_isa.c
@@ -225,7 +225,8 @@ iavc_isa_attach(device_t dev)
sc->sc_txq.ifq_maxlen = sc->sc_capi.sc_nbch * 4;
#if defined (__FreeBSD__) && __FreeBSD__ > 4
- mtx_init(&sc->sc_txq.ifq_mtx, "i4b_ivac_isa", MTX_DEF);
+ if(!mtx_initialized(&sc->sc_txq.ifq_mtx))
+ mtx_init(&sc->sc_txq.ifq_mtx, "i4b_ivac_isa", MTX_DEF);
#endif
sc->sc_intr = FALSE;
diff --git a/sys/i4b/capi/iavc/iavc_pci.c b/sys/i4b/capi/iavc/iavc_pci.c
index 5579a3c..12de906 100644
--- a/sys/i4b/capi/iavc/iavc_pci.c
+++ b/sys/i4b/capi/iavc/iavc_pci.c
@@ -236,7 +236,8 @@ iavc_pci_attach(device_t dev)
sc->sc_txq.ifq_maxlen = sc->sc_capi.sc_nbch * 4;
#if defined (__FreeBSD__) && __FreeBSD__ > 4
- mtx_init(&sc->sc_txq.ifq_mtx, "i4b_ivac_pci", MTX_DEF);
+ if(!mtx_initialized(&sc->sc_txq.ifq_mtx))
+ mtx_init(&sc->sc_txq.ifq_mtx, "i4b_ivac_pci", MTX_DEF);
#endif
sc->sc_intr = FALSE;
OpenPOWER on IntegriCloud