Page MenuHomeFreeBSD

mbuf: provide m_freemp()
ClosedPublic

Authored by glebius on Jun 3 2024, 8:12 PM.
Tags
None
Referenced Files
F168916679: D45477.id.diff
Sun, Aug 30, 6:06 PM
F168907273: D45477.id.diff
Sun, Aug 30, 5:07 PM
F168851133: D45477.id139412.diff
Sun, Aug 30, 11:06 AM
F168845941: D45477.diff
Sun, Aug 30, 10:31 AM
Unknown Object (File)
Sat, Aug 29, 4:15 AM
Unknown Object (File)
Sat, Aug 29, 12:05 AM
Unknown Object (File)
Thu, Aug 27, 7:24 PM
Unknown Object (File)
Wed, Aug 26, 11:24 AM
Subscribers

Details

Summary

This function follows both m_nextpkt and m_next linkage freeing all mbufs.
Note that existing m_freem() follows only m_next.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Jun 3 2024, 8:15 PM
sys/kern/kern_mbuf.c
1595

m_freem() lets you pass NULL, but this function does not. Is that deliberate?

sys/kern/kern_mbuf.c
1595

Yes. I believe a good code should not call free(NULL). Of course we are obliged to support free(NULL) in userland and in kernel as well as some other freeing functions, e.g. m_freem(). I will provide a comment on top of m_freemp() that it doesn't support NULL argument.

This revision was automatically updated to reflect the committed changes.