diff options
Diffstat (limited to 'kernel/sched.c')
-rw-r--r-- | kernel/sched.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 27eaa47d438a..1ffa76813a01 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -4449,22 +4449,20 @@ do_wait_for_common(struct completion *x, long timeout, int state) | |||
4449 | signal_pending(current)) || | 4449 | signal_pending(current)) || |
4450 | (state == TASK_KILLABLE && | 4450 | (state == TASK_KILLABLE && |
4451 | fatal_signal_pending(current))) { | 4451 | fatal_signal_pending(current))) { |
4452 | __remove_wait_queue(&x->wait, &wait); | 4452 | timeout = -ERESTARTSYS; |
4453 | return -ERESTARTSYS; | 4453 | break; |
4454 | } | 4454 | } |
4455 | __set_current_state(state); | 4455 | __set_current_state(state); |
4456 | spin_unlock_irq(&x->wait.lock); | 4456 | spin_unlock_irq(&x->wait.lock); |
4457 | timeout = schedule_timeout(timeout); | 4457 | timeout = schedule_timeout(timeout); |
4458 | spin_lock_irq(&x->wait.lock); | 4458 | spin_lock_irq(&x->wait.lock); |
4459 | if (!timeout) { | 4459 | } while (!x->done && timeout); |
4460 | __remove_wait_queue(&x->wait, &wait); | ||
4461 | return timeout; | ||
4462 | } | ||
4463 | } while (!x->done); | ||
4464 | __remove_wait_queue(&x->wait, &wait); | 4460 | __remove_wait_queue(&x->wait, &wait); |
4461 | if (!x->done) | ||
4462 | return timeout; | ||
4465 | } | 4463 | } |
4466 | x->done--; | 4464 | x->done--; |
4467 | return timeout; | 4465 | return timeout ?: 1; |
4468 | } | 4466 | } |
4469 | 4467 | ||
4470 | static long __sched | 4468 | static long __sched |