1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-01 12:19:28 +00:00

Merge r254736 from user/np/cxl_tuning.

Don't leak tags when M_NOFREE | M_PKTHDR mbufs are freed.

Reviewed by:	andre
This commit is contained in:
Navdeep Parhar 2013-08-29 08:07:35 +00:00
parent 480e603c79
commit 91d1b03d36
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=255016

View File

@ -646,18 +646,6 @@ m_getcl(int how, short type, int flags)
return (uma_zalloc_arg(zone_pack, &args, how));
}
static __inline struct mbuf *
m_free(struct mbuf *m)
{
struct mbuf *n = m->m_next;
if (m->m_flags & M_EXT)
mb_free_ext(m);
else if ((m->m_flags & M_NOFREE) == 0)
uma_zfree(zone_mbuf, m);
return (n);
}
static __inline void
m_clget(struct mbuf *m, int how)
{
@ -1124,6 +1112,20 @@ m_tag_find(struct mbuf *m, int type, struct m_tag *start)
m_tag_locate(m, MTAG_ABI_COMPAT, type, start));
}
static __inline struct mbuf *
m_free(struct mbuf *m)
{
struct mbuf *n = m->m_next;
if ((m->m_flags & (M_PKTHDR|M_NOFREE)) == (M_PKTHDR|M_NOFREE))
m_tag_delete_chain(m, NULL);
if (m->m_flags & M_EXT)
mb_free_ext(m);
else if ((m->m_flags & M_NOFREE) == 0)
uma_zfree(zone_mbuf, m);
return (n);
}
static int inline
rt_m_getfib(struct mbuf *m)
{