On Fri, Jun 09 2017, Axel Lin wrote:
> It is wrong to do --i in the for loop.
>
> Fixes: dd02ea5a3305 ("usb: gadget: mass_storage: Use static array for luns")
> Signed-off-by: Axel Lin <axel....@ingics.com>

Acked-by: Michal Nazarewicz <min...@mina86.com>

> ---
>  drivers/usb/gadget/function/f_mass_storage.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/gadget/function/f_mass_storage.c 
> b/drivers/usb/gadget/function/f_mass_storage.c
> index 74d57d6..5742813 100644
> --- a/drivers/usb/gadget/function/f_mass_storage.c
> +++ b/drivers/usb/gadget/function/f_mass_storage.c
> @@ -2572,7 +2572,7 @@ static int fsg_main_thread(void *common_)
>               int i;
>  
>               down_write(&common->filesem);
> -             for (i = 0; i < ARRAY_SIZE(common->luns); --i) {
> +             for (i = 0; i < ARRAY_SIZE(common->luns); i++) {
>                       struct fsg_lun *curlun = common->luns[i];
>                       if (!curlun || !fsg_lun_is_open(curlun))
>                               continue;

-- 
Best regards
ミハウ “𝓶𝓲𝓷𝓪86” ナザレヴイツ
«If at first you don’t succeed, give up skydiving»
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to