ChangeSet 1.1743.3.5, 2004/05/24 17:03:52-07:00, oliver@neukum.org

[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


 drivers/usb/net/kaweth.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)


diff -Nru a/drivers/usb/net/kaweth.c b/drivers/usb/net/kaweth.c
--- a/drivers/usb/net/kaweth.c	Fri May 28 14:41:31 2004
+++ b/drivers/usb/net/kaweth.c	Fri May 28 14:41:31 2004
@@ -1250,9 +1250,10 @@
                 return status;
         }
 
+	set_current_state(TASK_UNINTERRUPTIBLE);
 	while (timeout && !awd.done) {
-		set_current_state(TASK_UNINTERRUPTIBLE);
 		timeout = schedule_timeout(timeout);
+		set_current_state(TASK_UNINTERRUPTIBLE);
 	}
 
         set_current_state(TASK_RUNNING);
