Renew semaphore's pointer after wakeup since during msleep
sem_base may have been modified by destroying one of semaphores and semptr would not be valid in this case. PR: kern/123731
This commit is contained in:
parent
145d2d3ac4
commit
23c8064e66
@ -1166,6 +1166,13 @@ semop(td, uap)
|
||||
goto done2;
|
||||
}
|
||||
|
||||
/*
|
||||
* 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.
|
||||
|
Loading…
Reference in New Issue
Block a user