summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/sysv_sem.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/kern/sysv_sem.c b/sys/kern/sysv_sem.c
index bea7832..80d07ba 100644
--- a/sys/kern/sysv_sem.c
+++ b/sys/kern/sysv_sem.c
@@ -1167,6 +1167,13 @@ semop(td, uap)
}
/*
+ * Renew the semaphore's pointer after wakeup since
+ * during msleep sem_base may have been modified and semptr
+ * is not valid any more
+ */
+ semptr = &semakptr->u.sem_base[sopptr->sem_num];
+
+ /*
* The semaphore is still alive. Readjust the count of
* waiting processes.
*/
OpenPOWER on IntegriCloud