Page MenuHomeFreeBSD

kobj: Use M_WAITOK in kobj_init
ClosedPublic

Authored by jhb on Apr 24 2026, 8:00 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Sep 3, 8:10 AM
Unknown Object (File)
Fri, Aug 28, 3:32 PM
Unknown Object (File)
Fri, Aug 28, 3:31 PM
Unknown Object (File)
Fri, Aug 28, 2:58 PM
Unknown Object (File)
Wed, Aug 12, 11:46 PM
Unknown Object (File)
Wed, Aug 12, 11:19 PM
Unknown Object (File)
Aug 11 2026, 5:36 AM
Unknown Object (File)
Aug 10 2026, 11:15 AM
Subscribers

Details

Summary

Blocking allocation is safe in all of the current callers of kobj_init
(most of them do a M_WAIT malloc of the structure passed as the first
argument to kobj_init just before calling it). kobj_init doesn't
return an error code but instead panics if the nested malloc in
kobj_class_compile1 fails, so using M_WAITOK here is more robust.

Diff Detail

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