mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-09 04:15:52 +00:00
Bug fix: null ptr dereference in base/semaphore
If nobody is blocked in a semaphore, nothing can be dequeued. If the semaphore is used for signalling, there can be somebody in the queue, but not necessarily.
This commit is contained in:
parent
c873faa390
commit
f612475c99
@ -128,7 +128,9 @@ namespace Genode {
|
||||
* Remove element from queue and wake up the corresponding
|
||||
* blocking thread
|
||||
*/
|
||||
_queue.dequeue()->wake_up();
|
||||
Semaphore_queue::Element * element = _queue.dequeue();
|
||||
if (element)
|
||||
element->wake_up();
|
||||
}
|
||||
|
||||
void down()
|
||||
|
Loading…
x
Reference in New Issue
Block a user