]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Don't invoke semunload() if seminit() fails during MOD_LOAD.
authorJohn Baldwin <jhb@FreeBSD.org>
Fri, 9 Oct 2020 20:20:42 +0000 (20:20 +0000)
committerJohn Baldwin <jhb@FreeBSD.org>
Fri, 9 Oct 2020 20:20:42 +0000 (20:20 +0000)
commit7e8bd70cff019c5aa0bf1a69e3e1fa00985c358d
tree2aa26c37f15e6c1483c3d3eff84d1a6d1b02b2b4
parent3d265fce43746c293ae826e9603adbfe09f93cf6
Don't invoke semunload() if seminit() fails during MOD_LOAD.

The module handler code invokes a MOD_UNLOAD event immediately if
MOD_LOAD fails.  The result was that if seminit() failed, semunload()
was invoked twice.  semunload() is not idempotent however and would
try to remove it's process_exit eventhandler twice resulting in a
panic.

Reviewed by: kib, markj
Obtained from: CheriBSD
MFC after: 1 month
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D26696
sys/kern/sysv_sem.c