To allocate an SDMA channel, imx_dma_data struct is need. However,
if the member dma_request_p2p is not set to 0 before configuration,
SDMA driver would treat the channel as p2p(periphal to periphal) DMA and
set SDMA channel context in p2p way. In the worst case, SDMA would
access some unexisted address cause of mis configuration above and thus
cause kernel panic or hang.
In this patch, set imx_dma_data struct to 0 once it is allocated from
stack.
Signed-off-by: Chen Liangjun <b36089@freescale.com>
static struct dma_chan *imx_asrc_dma_alloc(u32 dma_req)
{
dma_cap_mask_t mask;
- struct imx_dma_data dma_data;
+ struct imx_dma_data dma_data = {0};
dma_data.peripheral_type = IMX_DMATYPE_ASRC;
dma_data.priority = DMA_PRIO_MEDIUM;