Also call construct_mbuf() from m_getjcl() as it initializes the mbuf fields. It

also handles the M_PKTHDR flag. Before, the uninitialized fields could be left over
from earlier freed mbufs and on m_freem previous m_next fields could be returned
resulting in random mbufs being freed. This makes the iprowifi4965 work and fixes
#5089.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34691 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz 2009-12-18 18:00:11 +00:00
parent 861f2ade03
commit de86f3421c

View File

@ -188,11 +188,11 @@ m_getjcl(int how, short type, int flags, int size)
(struct mbuf *)object_cache_alloc(sMBufCache, m_to_oc_flags(how));
if (mb == NULL)
return NULL;
construct_mbuf(mb, type, flags);
if (construct_ext_sized_mbuf(mb, how, size) < 0) {
object_cache_free(sMBufCache, mb);
return NULL;
}
mb->m_flags |= flags;
return mb;
}