From 1d752b5e0fd3b9e43dc0c2f6db9cd893c56101ee Mon Sep 17 00:00:00 2001 From: Hajimu UMEMOTO Date: Wed, 13 Jun 2001 18:53:53 +0000 Subject: [PATCH] fix recursive mtx_lock() call. Submitted by: mjacob --- sys/sys/mbuf.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h index bfc2bee3e80c..0752ca46cc2c 100644 --- a/sys/sys/mbuf.h +++ b/sys/sys/mbuf.h @@ -531,6 +531,7 @@ struct mcntfree_lst { */ #define MFREE(m, n) do { \ struct mbuf *_mm = (m); \ + struct mbuf *_aux; \ \ KASSERT(_mm->m_type != MT_FREE, ("freeing free mbuf")); \ if (_mm->m_flags & M_EXT) \ @@ -538,8 +539,10 @@ struct mcntfree_lst { mtx_lock(&mbuf_mtx); \ mbtypes[_mm->m_type]--; \ if ((_mm->m_flags & M_PKTHDR) != 0 && _mm->m_pkthdr.aux) { \ - m_freem(_mm->m_pkthdr.aux); \ + _aux = _mm->m_pkthdr.aux; \ _mm->m_pkthdr.aux = NULL; \ + } else { \ + _aux = NULL; \ } \ _mm->m_type = MT_FREE; \ mbtypes[MT_FREE]++; \ @@ -548,6 +551,8 @@ struct mcntfree_lst { mmbfree.m_head = _mm; \ MBWAKEUP(m_mballoc_wid, &mmbfree.m_starved); \ mtx_unlock(&mbuf_mtx); \ + if (_aux) \ + m_freem(_aux); \ } while (0) /*