diff options
author | ume <ume@FreeBSD.org> | 2001-06-13 18:53:53 +0000 |
---|---|---|
committer | ume <ume@FreeBSD.org> | 2001-06-13 18:53:53 +0000 |
commit | 34d0670980032e9edaf6585f0a78e8fceac30c1c (patch) | |
tree | a698904cc377580eebc83302754849dedd2a681a | |
parent | ec5e03bd09a6ee17cb2d59646090e588babdd83f (diff) | |
download | FreeBSD-src-34d0670980032e9edaf6585f0a78e8fceac30c1c.zip FreeBSD-src-34d0670980032e9edaf6585f0a78e8fceac30c1c.tar.gz |
fix recursive mtx_lock() call.
Submitted by: mjacob
-rw-r--r-- | sys/sys/mbuf.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h index bfc2bee..0752ca4 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) /* |