Skip to content

Commit

Permalink
usb: isp1760: fix qtd fill length
Browse files Browse the repository at this point in the history
[ Upstream commit cbfa3ef ]

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 <dietmar.eggemann@arm.com>
Tested-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Link: https://lore.kernel.org/r/20210827131154.4151862-3-rui.silva@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
rmsilva authored and gregkh committed Sep 18, 2021
1 parent ce1ef47 commit 4fa2620
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/usb/isp1760/isp1760-hcd.c
Expand Up @@ -1826,9 +1826,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;
Expand Down

0 comments on commit 4fa2620

Please sign in to comment.