From: Janusz Dziedzic Date: Wed, 9 Nov 2016 10:01:33 +0000 (+0100) Subject: usb: dwc3: fix post-increment X-Git-Tag: v4.10-rc1~150^2~57^2~61 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=e3aee48692ac063fbb568bcf36a5a0e37c62079a;p=karo-tx-linux.git usb: dwc3: fix post-increment Use pre-increment and set -ETIMEDOUT correctly. Signed-off-by: Janusz Dziedzic Signed-off-by: Felipe Balbi --- diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 9262ef20f7c6..af9e8853d8fb 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -214,7 +214,7 @@ int dwc3_send_gadget_generic_command(struct dwc3 *dwc, unsigned cmd, u32 param) ret = -EINVAL; break; } - } while (timeout--); + } while (--timeout); if (!timeout) { ret = -ETIMEDOUT;