Commit 14607200 authored by Jan Kiszka's avatar Jan Kiszka

kernel/cobalt/posix: Fix cobalt_event_wait for COBALT_EVENT_ALL case

When we wait for all passed event bits to be set, we need to test for
those bits, not the ones that are currently pending. The current code
fails to detect that the condition is met when both the desired as well
as other events are already pending.

Reported by: Ronny Meeus <>
Signed-off-by: Jan Kiszka's avatarJan Kiszka <>
parent 6acf665f
......@@ -153,7 +153,7 @@ int __cobalt_event_wait(struct cobalt_event_shadow __user *u_event,
state->flags |= COBALT_EVENT_PENDED;
rbits = state->value & bits;
testval = mode & COBALT_EVENT_ANY ? rbits : state->value;
testval = mode & COBALT_EVENT_ANY ? rbits : bits;
if (rbits && rbits == testval)
goto done;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment