Skip to content

Commit f757f92

Browse files
rmsilvagregkh
authored andcommitted
usb: isp1760: fix memory pool initialization
The loops to setup the memory pool were skipping some blocks, that was not visible on the ISP1763 because it has fewer blocks than the ISP1761. But won testing on that IP from the family that would be an issue. 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]>
1 parent f73800a commit f757f92

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/usb/isp1760/isp1760-hcd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -588,8 +588,8 @@ static void init_memory(struct isp1760_hcd *priv)
588588

589589
payload_addr = PAYLOAD_OFFSET;
590590

591-
for (i = 0, curr = 0; i < ARRAY_SIZE(mem->blocks); i++) {
592-
for (j = 0; j < mem->blocks[i]; j++, curr++) {
591+
for (i = 0, curr = 0; i < ARRAY_SIZE(mem->blocks); i++, curr += j) {
592+
for (j = 0; j < mem->blocks[i]; j++) {
593593
priv->memory_pool[curr + j].start = payload_addr;
594594
priv->memory_pool[curr + j].size = mem->blocks_size[i];
595595
priv->memory_pool[curr + j].free = 1;

0 commit comments

Comments
 (0)