lentferj's projects
/
dragonfly.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
aa1f2da
)
kernel - cleanup & assertions in mbuf code
author
Matthew Dillon <dillon@laptop2.(none)>
Sat, 11 Sep 2010 18:52:45 +0000 (11:52 -0700)
committer
Matthew Dillon <dillon@laptop2.(none)>
Sat, 11 Sep 2010 18:52:45 +0000 (11:52 -0700)
* Assert the mbuf's next/nextpkt fields are NULL on allocation.
sys/kern/uipc_mbuf.c
patch
|
blob
|
blame
|
history
diff --git
a/sys/kern/uipc_mbuf.c
b/sys/kern/uipc_mbuf.c
index
e0c8030
..
75120a2
100644
(file)
--- a/
sys/kern/uipc_mbuf.c
+++ b/
sys/kern/uipc_mbuf.c
@@
-666,9
+666,11
@@
static void __inline
updatestats(struct mbuf *m, int type)
{
struct globaldata *gd = mycpu;
- m->m_type = type;
+ m->m_type = type;
mbuftrack(m);
+ KKASSERT(m->m_next == NULL);
+ KKASSERT(m->m_nextpkt == NULL);
atomic_add_long_nonlocked(&mbtypes[gd->gd_cpuid][type], 1);
atomic_add_long_nonlocked(&mbstat[mycpu->gd_cpuid].m_mbufs, 1);