Commit a79741fd authored by Colin Ian King's avatar Colin Ian King Committed by Felipe Balbi

usb: gadget: dummy: fix infinite loop because of missing loop decrement

The while loop never terminates because the loop counter i is never
decremented. Fix this by decrementing i.

Detected by CoverityScan, CID#751073 ("Infinite Loop")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent c0542900
...@@ -2776,7 +2776,7 @@ static int __init init(void) ...@@ -2776,7 +2776,7 @@ static int __init init(void)
if (retval < 0) { if (retval < 0) {
i--; i--;
while (i >= 0) while (i >= 0)
platform_device_del(the_udc_pdev[i]); platform_device_del(the_udc_pdev[i--]);
goto err_add_udc; goto err_add_udc;
} }
} }
......
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