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/layer2/i4b_l2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sys/i4b/layer2') diff --git a/sys/i4b/layer2/i4b_l2.c b/sys/i4b/layer2/i4b_l2.c index 0383812..96a4a15 100644 --- a/sys/i4b/layer2/i4b_l2.c +++ b/sys/i4b/layer2/i4b_l2.c @@ -277,7 +277,8 @@ i4b_mph_status_ind(int unit, int status, int parm) l2sc->i_queue.ifq_maxlen = IQUEUE_MAXLEN; #if defined(__FreeBSD__) && __FreeBSD__ > 4 - mtx_init(&l2sc->i_queue.ifq_mtx, "i4b_l2sc", MTX_DEF); + if(!mtx_initialized(&l2sc->i_queue.ifq_mtx)) + mtx_init(&l2sc->i_queue.ifq_mtx, "i4b_l2sc", MTX_DEF); #endif l2sc->ua_frame = NULL; bzero(&l2sc->stat, sizeof(lapdstat_t)); -- cgit v1.1