summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/udc/dummy_hcd.c
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2017-08-15 10:38:45 +0300
committerFelipe Balbi <felipe.balbi@linux.intel.com>2017-08-15 12:46:04 +0300
commita79741fdb0605d75323872035d858556c8388e77 (patch)
treeae9b276aa1f01200c9e2f24bfd0dd2d263dba107 /drivers/usb/gadget/udc/dummy_hcd.c
parentc05429005ba906bb88d6e50898d1f64604751dc2 (diff)
downloadlinux-a79741fdb0605d75323872035d858556c8388e77.tar.xz
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>
Diffstat (limited to 'drivers/usb/gadget/udc/dummy_hcd.c')
-rw-r--r--drivers/usb/gadget/udc/dummy_hcd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/gadget/udc/dummy_hcd.c b/drivers/usb/gadget/udc/dummy_hcd.c
index 3c3760315910..a030d7923d7d 100644
--- a/drivers/usb/gadget/udc/dummy_hcd.c
+++ b/drivers/usb/gadget/udc/dummy_hcd.c
@@ -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;
}
}