mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-03 18:12:25 -04:00
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:
committed by
Felipe Balbi
parent
c05429005b
commit
a79741fdb0
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user