Page MenuHomeFreeBSD

mbuf: provide m_freemp()
ClosedPublic

Authored by glebius on Jun 3 2024, 8:12 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Mar 13, 2:21 AM
Unknown Object (File)
Mon, Feb 24, 2:44 PM
Unknown Object (File)
Feb 8 2025, 2:30 AM
Unknown Object (File)
Feb 5 2025, 3:03 PM
Unknown Object (File)
Feb 5 2025, 12:14 PM
Unknown Object (File)
Jan 24 2025, 7:48 PM
Unknown Object (File)
Jan 19 2025, 7:57 PM
Unknown Object (File)
Jan 18 2025, 9:28 PM
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 Skipped
Unit
Tests Skipped
Build Status
Buildable 58043
Build 54931: arc lint + arc unit

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.