aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRui Miguel Silva <[email protected]>2021-08-27 14:11:51 +0100
committerGreg Kroah-Hartman <[email protected]>2021-08-27 16:11:38 +0200
commitcbfa3effdf5c2d411c9ce9820f3d33d77bc4697d (patch)
tree45713bd52fec7df31b311d4d05838d25f0fb8e53
parentf757f9291f920e1da4c6cfd4064c6bf59639983e (diff)
usb: isp1760: fix qtd fill length
When trying to send bulks bigger than the biggest block size we need to split them over several qtd. Fix this limiting the maximum qtd size to largest block size. Reported-by: Dietmar Eggemann <[email protected]> Tested-by: Dietmar Eggemann <[email protected]> Signed-off-by: Rui Miguel Silva <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
-rw-r--r--drivers/usb/isp1760/isp1760-hcd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/usb/isp1760/isp1760-hcd.c b/drivers/usb/isp1760/isp1760-hcd.c
index b3a55c5d2155..fba21122bb00 100644
--- a/drivers/usb/isp1760/isp1760-hcd.c
+++ b/drivers/usb/isp1760/isp1760-hcd.c
@@ -1829,9 +1829,11 @@ static void packetize_urb(struct usb_hcd *hcd,
goto cleanup;
if (len > mem->blocks_size[ISP176x_BLOCK_NUM - 1])
- len = mem->blocks_size[ISP176x_BLOCK_NUM - 1];
+ this_qtd_len = mem->blocks_size[ISP176x_BLOCK_NUM - 1];
+ else
+ this_qtd_len = len;
- this_qtd_len = qtd_fill(qtd, buf, len);
+ this_qtd_len = qtd_fill(qtd, buf, this_qtd_len);
list_add_tail(&qtd->qtd_list, head);
len -= this_qtd_len;