From cb1c79008ee951895ac07a66dff92c6e97ec8066 Mon Sep 17 00:00:00 2001 From: Mateusz Guzik Date: Thu, 19 Oct 2017 00:31:00 +0000 Subject: [PATCH] sysvsem: check if semu_list has anything on it before grabbing the lock This should get a process-specific support instead. MFC after: 1 week --- sys/kern/sysv_sem.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/kern/sysv_sem.c b/sys/kern/sysv_sem.c index 60688960e24..116fc437e4b 100644 --- a/sys/kern/sysv_sem.c +++ b/sys/kern/sysv_sem.c @@ -1412,6 +1412,8 @@ semexit_myhook(void *arg, struct proc *p) * Go through the chain of undo vectors looking for one * associated with this process. */ + if (LIST_EMPTY(&semu_list)) + return; SEMUNDO_LOCK(); LIST_FOREACH(suptr, &semu_list, un_next) { if (suptr->un_proc == p)