diff options
author | Rui Miguel Silva <rui.silva@linaro.org> | 2021-08-27 16:11:50 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-08-27 17:11:38 +0300 |
commit | f757f9291f920e1da4c6cfd4064c6bf59639983e (patch) | |
tree | c6a9351a7bc6738bc913d7b263d5111d95351d23 /drivers/usb/isp1760 | |
parent | f73800a905a8a9c35b989e8de9ce5cdf328c2b63 (diff) | |
download | linux-f757f9291f920e1da4c6cfd4064c6bf59639983e.tar.xz |
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 <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-2-rui.silva@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/isp1760')
-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; |