Commit 461b6851 authored by Oliver Neukum's avatar Oliver Neukum Committed by Greg Kroah-Hartman

[PATCH] USB: fix fix to kaweth.c

the previous patch was buggy. The state must be set _before_ the
condition is checked, or there's a window missing a wakeup.
This incremental change set fixes that.

  - fix race condition with current->state
parent b0eef108
...@@ -1250,9 +1250,10 @@ static int usb_start_wait_urb(struct urb *urb, int timeout, int* actual_length) ...@@ -1250,9 +1250,10 @@ static int usb_start_wait_urb(struct urb *urb, int timeout, int* actual_length)
return status; return status;
} }
while (timeout && !awd.done) {
set_current_state(TASK_UNINTERRUPTIBLE); set_current_state(TASK_UNINTERRUPTIBLE);
while (timeout && !awd.done) {
timeout = schedule_timeout(timeout); timeout = schedule_timeout(timeout);
set_current_state(TASK_UNINTERRUPTIBLE);
} }
set_current_state(TASK_RUNNING); set_current_state(TASK_RUNNING);
......
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