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: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
This commit is contained in:
Colin Ian King
2017-08-15 08:38:45 +01:00
committed by Felipe Balbi
parent c05429005b
commit a79741fdb0

View File

@@ -2776,7 +2776,7 @@ static int __init init(void)
if (retval < 0) {
i--;
while (i >= 0)
platform_device_del(the_udc_pdev[i]);
platform_device_del(the_udc_pdev[i--]);
goto err_add_udc;
}
}