[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1487142073.18610.1.camel@suse.com>
Date: Wed, 15 Feb 2017 08:01:13 +0100
From: Oliver Neukum <oneukum@...e.com>
To: "Gustavo A. R. Silva" <garsilva@...eddedor.com>,
stern@...land.harvard.edu, gregkh@...uxfoundation.org
Cc: linux-usb@...r.kernel.org, usb-storage@...ts.one-eyed-alien.net,
linux-kernel@...r.kernel.org,
Peter Senna Tschudi <peter.senna@...il.com>
Subject: Re: [usb-storage] usb: storage: suspicious code
Am Dienstag, den 14.02.2017, 23:06 -0600 schrieb Gustavo A. R. Silva:
Hi,
> waitcount = 0;
> do {
> result = jumpshot_get_status(us);
> if (result != USB_STOR_TRANSPORT_GOOD) {
> // I have not experimented to find the smallest
> value.
> //
> msleep(50);
> }
> } while ((result != USB_STOR_TRANSPORT_GOOD) && (waitcount <
> 10));
>
> if (result != USB_STOR_TRANSPORT_GOOD)
> usb_stor_dbg(us, "Gah! Waitcount = 10. Bad
> write!?\n");
>
> Variable 'waitcount' is never updated inside the do-while loop. So,
> either it isn't needed at all or line 316 should be modified
> (++waitcount < 10)
you are correct. Waitcount needs to be incremented.
HTH
Oliver
Powered by blists - more mailing lists