1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

* check for null pointer in mutex wake waiters function

This commit is contained in:
Oliver Hahm 2010-11-01 13:29:40 +01:00
parent 13b651ee86
commit 5b3209ea19

View File

@ -103,6 +103,13 @@ void mutex_wake_waiters(struct mutex_t *mutex, int flags) {
DEBUG("%s: waking up waiters.\n", active_thread->name);
queue_node_t *next = queue_remove_head(&(mutex->queue));
/* queue is empty */
if (!next) {
mutex->val = 0;
return;
}
tcb* process = (tcb*)next->data;
sched_set_status(process, STATUS_PENDING);