Commit bb732b14 authored by Dan Carpenter's avatar Dan Carpenter Committed by Luis Henriques

usb: gadget: m66592-udc: forever loop in set_feature()

commit 5feb5d20 upstream.

There is an "&&" vs "||" typo here so this loops 3000 times or if we get
unlucky it could loop forever.

Fixes: ceaa0a6e ('usb: gadget: m66592-udc: add support for TEST_MODE')
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
[ luis: backported to 3.16:
  - file rename: drivers/usb/gadget/udc/m66592-udc.c ->
    drivers/usb/gadget/m66592-udc.c ]
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent 043bf07c
......@@ -1052,7 +1052,7 @@ static void set_feature(struct m66592 *m66592, struct usb_ctrlrequest *ctrl)
tmp = m66592_read(m66592, M66592_INTSTS0) &
M66592_CTSQ;
udelay(1);
} while (tmp != M66592_CS_IDST || timeout-- > 0);
} while (tmp != M66592_CS_IDST && timeout-- > 0);
if (tmp == M66592_CS_IDST)
m66592_bset(m66592,
......
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