ChangeSet 1.1673.8.30, 2004/03/26 12:30:48-08:00, arjanv@redhat.com [PATCH] USB: fix race in whiteheat serial driver Patch below fixes an obvious race in the whiteheat usb serial driver... drivers/usb/serial/whiteheat.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) diff -Nru a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c --- a/drivers/usb/serial/whiteheat.c Wed Apr 14 14:37:47 2004 +++ b/drivers/usb/serial/whiteheat.c Wed Apr 14 14:37:47 2004 @@ -1153,10 +1153,8 @@ } /* wait for the command to complete */ - timeout = COMMAND_TIMEOUT; - while (timeout && (command_info->command_finished == FALSE)) { - timeout = interruptible_sleep_on_timeout (&command_info->wait_command, timeout); - } + wait_event_interruptible_timeout(command_info->wait_command, + (command_info->command_finished != FALSE), COMMAND_TIMEOUT); spin_lock_irqsave(&command_info->lock, flags);