From f71e78a1d929115bddfa44b7ba5613fbbea6d905 Mon Sep 17 00:00:00 2001 From: Michael Tuexen Date: Sun, 11 Oct 2009 12:23:56 +0000 Subject: [PATCH] Fix a race condition where a mutex was destroyed while sleeping on it. Found while analyzing a report from julian. It might fix his bug. Approved by: rrs (mentor) MFC after: 3 days --- sys/netinet/sctp_bsd_addr.c | 1 + sys/netinet/sctp_pcb.c | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/sctp_bsd_addr.c b/sys/netinet/sctp_bsd_addr.c index 6a8dfc91163e..e508a4ab986e 100644 --- a/sys/netinet/sctp_bsd_addr.c +++ b/sys/netinet/sctp_bsd_addr.c @@ -97,6 +97,7 @@ sctp_iterator_thread(void *v) &SCTP_BASE_INFO(ipi_iterator_wq_mtx), 0, "waiting_for_work", 0); if (SCTP_BASE_INFO(threads_must_exit)) { + SCTP_IPI_ITERATOR_WQ_DESTROY(); kthread_exit(); } sctp_iterator_worker(); diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 21cd88998a8a..7d12f375a8e9 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -5616,7 +5616,6 @@ sctp_pcb_finish(void) SCTP_IP_PKTLOG_DESTROY(); #endif - SCTP_IPI_ITERATOR_WQ_DESTROY(); SCTP_IPI_ADDR_DESTROY(); SCTP_ITERATOR_LOCK_DESTROY(); SCTP_STATLOG_DESTROY();