Skip to content

Commit be4cf71

Browse files
saschahauervinodkoul
authored andcommitted
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 <[email protected]> Reviewed-by: Robin Gong <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 7ae6d7b commit be4cf71

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/dma/imx-sdma.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2063,7 +2063,7 @@ static int sdma_probe(struct platform_device *pdev)
20632063

20642064
/* initially no scripts available */
20652065
saddr_arr = (s32 *)sdma->script_addrs;
2066-
for (i = 0; i < SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V1; i++)
2066+
for (i = 0; i < sizeof(*sdma->script_addrs) / sizeof(s32); i++)
20672067
saddr_arr[i] = -EINVAL;
20682068

20692069
dma_cap_set(DMA_SLAVE, sdma->dma_device.cap_mask);

0 commit comments

Comments
 (0)