Skip to content

Commit 91f172e

Browse files
mmahadevan108nashif
authored andcommitted
drivers: dma: Zero-initialize memory allocated using kmalloc
The code was wrongly calling DMA_Abort on a channel that not initialized. This fixes Issue#38078 Signed-off-by: Mahesh Mahadevan <[email protected]>
1 parent a020958 commit 91f172e

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/dma/dma_mcux_lpc.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -485,9 +485,7 @@ static int dma_mcux_lpc_init(const struct device *dev)
485485
return -ENOMEM;
486486
}
487487

488-
for (int i = 0; i < DEV_CFG(dev)->num_of_channels; i++) {
489-
data->data_cb[i].dma_descriptor_table = NULL;
490-
}
488+
memset(data->data_cb, 0, size_channel_data);
491489

492490
#if defined FSL_FEATURE_DMA_NUMBER_OF_CHANNELS
493491
total_dma_channels = FSL_FEATURE_DMA_NUMBER_OF_CHANNELS;

0 commit comments

Comments
 (0)