diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2020-05-13 08:04:05 +0200 |
---|---|---|
committer | Vinod Koul <vkoul@kernel.org> | 2020-05-15 12:31:06 +0530 |
commit | be4cf718cd9929e867ed1ff06d23fb4d08cc2d36 (patch) | |
tree | 6007978a254890cebd76db4600b1af03c8185c63 | |
parent | 7ae6d7bd7397e46bd72cb85ab573a669c4dac925 (diff) |
dmaengine: imx-sdma: initialize all script addresses
The script addresses array increases with each new version. The driver
initializes the array to -EINVAL initially, but only up to the size
of the v1 array. Initialize the additional addresses for the newer
versions as well. Without this uninitialized values of the newer arrays
are treated as valid.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: Robin Gong <yibin.gong@nxp.com>
Link: https://lore.kernel.org/r/20200513060405.18685-1-s.hauer@pengutronix.de
Signed-off-by: Vinod Koul <vkoul@kernel.org>
-rw-r--r-- | drivers/dma/imx-sdma.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index 4d4477df4ede..91774039ae5d 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -2063,7 +2063,7 @@ static int sdma_probe(struct platform_device *pdev) /* initially no scripts available */ saddr_arr = (s32 *)sdma->script_addrs; - for (i = 0; i < SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V1; i++) + for (i = 0; i < sizeof(*sdma->script_addrs) / sizeof(s32); i++) saddr_arr[i] = -EINVAL; dma_cap_set(DMA_SLAVE, sdma->dma_device.cap_mask); |