usb: gadget: m66592-udc: forever loop in set_feature()
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 29 Jul 2015 21:30:58 +0000 (00:30 +0300)
committerFelipe Balbi <balbi@ti.com>
Thu, 30 Jul 2015 16:43:37 +0000 (11:43 -0500)
There is an "&&" vs "||" typo here so this loops 3000 times or if we get
unlucky it could loop forever.

Fixes: ceaa0a6eeadf ('usb: gadget: m66592-udc: add support for TEST_MODE')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/udc/m66592-udc.c

index 309706fe4bf0ab0fd61d37a492a2bef0d73deb2a..9704053dfe05337a39727cb59ecf4dea2e1a154d 100644 (file)
@@ -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,