[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.44L0.1708150951260.1684-100000@iolanthe.rowland.org>
Date: Tue, 15 Aug 2017 09:51:55 -0400 (EDT)
From: Alan Stern <stern@...land.harvard.edu>
To: Colin King <colin.king@...onical.com>
cc: Felipe Balbi <balbi@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Peter Chen <peter.chen@....com>,
Johan Hovold <johan@...nel.org>,
Yuyang Du <yuyang.du@...el.com>, <linux-usb@...r.kernel.org>,
<kernel-janitors@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] usb: gadget: dummy: fix infinite loop because of missing
loop decrement
On Tue, 15 Aug 2017, Colin King wrote:
> From: Colin Ian King <colin.king@...onical.com>
>
> 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@...onical.com>
> ---
> drivers/usb/gadget/udc/dummy_hcd.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> 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;
> }
> }
Acked-by: Alan Stern <stern@...land.harvard.edu>
Powered by blists - more mailing lists