[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Thu, 2 Feb 2017 13:19:10 +0000
From: Colin King <colin.king@...onical.com>
To: Alan Stern <stern@...land.harvard.edu>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-usb@...r.kernel.org, usb-storage@...ts.one-eyed-alien.net
Cc: kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org,
stable@...r.kernel.org
Subject: [PATCH] usb: storage: fix infinite wait loop by incrementing loop counter
From: Colin Ian King <colin.king@...onical.com>
If jumpshot_get_status continues to return a failed result then the
wait loop will spin forever because the waitcount counter is never
being incremented and we don't ever timeout. Fix this by incrementing
waitcount.
Cc: <stable@...r.kernel.org>
Signed-off-by: Colin Ian King <colin.king@...onical.com>
---
drivers/usb/storage/jumpshot.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/usb/storage/jumpshot.c b/drivers/usb/storage/jumpshot.c
index 011e527..81d82ce 100644
--- a/drivers/usb/storage/jumpshot.c
+++ b/drivers/usb/storage/jumpshot.c
@@ -311,6 +311,7 @@ static int jumpshot_write_data(struct us_data *us,
if (result != USB_STOR_TRANSPORT_GOOD) {
// I have not experimented to find the smallest value.
//
+ waitcount++;
msleep(50);
}
} while ((result != USB_STOR_TRANSPORT_GOOD) && (waitcount < 10));
--
2.10.2
Powered by blists - more mailing lists