Skip to content
Snippets Groups Projects
Commit 5b3209ea authored by Oleg Hahm's avatar Oleg Hahm
Browse files

* check for null pointer in mutex wake waiters function

parent 13b651ee
Branches
No related tags found
No related merge requests found
...@@ -103,6 +103,13 @@ void mutex_wake_waiters(struct mutex_t *mutex, int flags) { ...@@ -103,6 +103,13 @@ void mutex_wake_waiters(struct mutex_t *mutex, int flags) {
DEBUG("%s: waking up waiters.\n", active_thread->name); DEBUG("%s: waking up waiters.\n", active_thread->name);
queue_node_t *next = queue_remove_head(&(mutex->queue)); queue_node_t *next = queue_remove_head(&(mutex->queue));
/* queue is empty */
if (!next) {
mutex->val = 0;
return;
}
tcb* process = (tcb*)next->data; tcb* process = (tcb*)next->data;
sched_set_status(process, STATUS_PENDING); sched_set_status(process, STATUS_PENDING);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment