mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-19 03:06:39 +00:00
Bug fix: null ptr dereference in base/lock
Don't fail if nobody is holding the lock.
This commit is contained in:
parent
f612475c99
commit
f328f3786b
@ -110,13 +110,14 @@ void Cancelable_lock::lock()
|
||||
|
||||
|
||||
/* check if we are the applicant to be waken up next */
|
||||
if (*_owner.applicant_to_wake_up() == myself) {
|
||||
Applicant *a = _owner.applicant_to_wake_up();
|
||||
if (a && (*a == myself)) {
|
||||
|
||||
_owner.applicant_to_wake_up(myself.applicant_to_wake_up());
|
||||
|
||||
/* otherwise, go through the list of remaining applicants */
|
||||
} else {
|
||||
|
||||
Applicant *a = _owner.applicant_to_wake_up();
|
||||
for (; a; a = a->applicant_to_wake_up()) {
|
||||
|
||||
/* remove reference to ourself from the applicants list */
|
||||
|
Loading…
Reference in New Issue
Block a user