aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/sched.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 4a3cb0614158..577f160131bd 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -4405,6 +4405,16 @@ do_wait_for_common(struct completion *x, long timeout, int state)
4405 spin_unlock_irq(&x->wait.lock); 4405 spin_unlock_irq(&x->wait.lock);
4406 timeout = schedule_timeout(timeout); 4406 timeout = schedule_timeout(timeout);
4407 spin_lock_irq(&x->wait.lock); 4407 spin_lock_irq(&x->wait.lock);
4408
4409 /*
4410 * If the completion has arrived meanwhile
4411 * then return 1 jiffy time left:
4412 */
4413 if (x->done && !timeout) {
4414 timeout = 1;
4415 break;
4416 }
4417
4408 if (!timeout) { 4418 if (!timeout) {
4409 __remove_wait_queue(&x->wait, &wait); 4419 __remove_wait_queue(&x->wait, &wait);
4410 return timeout; 4420 return timeout;