diff options
author | Rui Miguel Silva <[email protected]> | 2021-08-27 14:11:50 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <[email protected]> | 2021-08-27 16:11:38 +0200 |
commit | f757f9291f920e1da4c6cfd4064c6bf59639983e (patch) | |
tree | c6a9351a7bc6738bc913d7b263d5111d95351d23 | |
parent | f73800a905a8a9c35b989e8de9ce5cdf328c2b63 (diff) |
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]>
-rw-r--r-- | drivers/usb/isp1760/isp1760-hcd.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/isp1760/isp1760-hcd.c b/drivers/usb/isp1760/isp1760-hcd.c index bf8ab3fe2e5a..b3a55c5d2155 100644 --- a/drivers/usb/isp1760/isp1760-hcd.c +++ b/drivers/usb/isp1760/isp1760-hcd.c @@ -588,8 +588,8 @@ static void init_memory(struct isp1760_hcd *priv) payload_addr = PAYLOAD_OFFSET; - for (i = 0, curr = 0; i < ARRAY_SIZE(mem->blocks); i++) { - for (j = 0; j < mem->blocks[i]; j++, curr++) { + for (i = 0, curr = 0; i < ARRAY_SIZE(mem->blocks); i++, curr += j) { + for (j = 0; j < mem->blocks[i]; j++) { priv->memory_pool[curr + j].start = payload_addr; priv->memory_pool[curr + j].size = mem->blocks_size[i]; priv->memory_pool[curr + j].free = 1; |