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:
Oleksandr Tymoshenko 2008-06-19 18:08:42 +00:00
parent 145d2d3ac4
commit 23c8064e66

View File

@ -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.