]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00218624 ASRC: set dma_data to 0 before config SDMA
authorChen Liangjun <b36089@freescale.com>
Fri, 27 Jul 2012 07:22:47 +0000 (15:22 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:35:07 +0000 (08:35 +0200)
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>
drivers/mxc/asrc/mxc_asrc.c

index 4ef31c8fd6db9435a9338d9f14bef34dd253b39b..f67274fccf5481da046b395f4d7893028d72e6c4 100644 (file)
@@ -952,7 +952,7 @@ static bool filter(struct dma_chan *chan, void *param)
 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;