提交 bee91869 编写于 作者: A Axel Lin 提交者: Felipe Balbi

usb: gadget: f_mass_storage: Fix the logic to iterate all common->luns

It is wrong to do --i in the for loop.

Fixes: dd02ea5a ("usb: gadget: mass_storage: Use static array for luns")
Signed-off-by: NAxel Lin <axel.lin@ingics.com>
Reviewed-by: NKrzysztof Opasiak <k.opasiak@samsung.com>
Acked-by: NMichal Nazarewicz <mina86@mina86.com>
Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
上级 ee249b45
......@@ -2490,7 +2490,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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册