Skip to content

Commit abdc9a3

Browse files
Dan Carpentergregkh
authored andcommitted
USB: ipaq.c: fix a timeout loop
The code expects the loop to end with "retries" set to zero but, because it is a post-op, it will end set to -1. I have fixed this by moving the decrement inside the loop. Fixes: 014aa2a ('USB: ipaq: minor ipaq_open() cleanup.') Signed-off-by: Dan Carpenter <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent fabb1c3 commit abdc9a3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/usb/serial/ipaq.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,8 @@ static int ipaq_open(struct tty_struct *tty,
531531
* through. Since this has a reasonably high failure rate, we retry
532532
* several times.
533533
*/
534-
while (retries--) {
534+
while (retries) {
535+
retries--;
535536
result = usb_control_msg(serial->dev,
536537
usb_sndctrlpipe(serial->dev, 0), 0x22, 0x21,
537538
0x1, 0, NULL, 0, 100);

0 commit comments

Comments
 (0)