Page MenuHomeFreeBSD

efirt(9): carefully destroy efi_lock
ClosedPublic

Authored by kib on Jun 20 2026, 12:23 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Aug 15, 8:03 AM
Unknown Object (File)
Wed, Aug 12, 7:50 PM
Unknown Object (File)
Tue, Aug 11, 9:19 PM
Unknown Object (File)
Tue, Aug 11, 12:57 AM
Unknown Object (File)
Mon, Aug 10, 2:19 PM
Unknown Object (File)
Mon, Aug 10, 10:02 AM
Unknown Object (File)
Sun, Aug 9, 3:27 AM
Unknown Object (File)
Sat, Aug 8, 7:03 AM
Subscribers
None

Details

Summary
efi_init() might return error after initializing the mutex, in which
case MOD_UNLOAD() is not processed, and the mutex is not destroyed.
Similarly, efi_uninit() skips any processing if efi_runtime was left as
NULL, leaving mutex not destroyed.

Initialize the mutex in MOD_LOAD case, and destroy in MOD_UNLOAD, also
handling errors.

Diff Detail

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

Event Timeline

kib requested review of this revision.Jun 20 2026, 12:23 PM
kib created this revision.
This revision is now accepted and ready to land.Jun 20 2026, 6:03 PM
This revision was automatically updated to reflect the committed changes.