From: Chen Liangjun Date: Fri, 27 Jul 2012 07:22:47 +0000 (+0800) Subject: ENGR00218624 ASRC: set dma_data to 0 before config SDMA X-Git-Tag: v3.0.35-fsl~683 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=e3070f6ed953aac3fae2195b8ec72f84445b2ee6;p=karo-tx-linux.git ENGR00218624 ASRC: set dma_data to 0 before config SDMA 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 --- diff --git a/drivers/mxc/asrc/mxc_asrc.c b/drivers/mxc/asrc/mxc_asrc.c index 4ef31c8fd6db..f67274fccf54 100644 --- a/drivers/mxc/asrc/mxc_asrc.c +++ b/drivers/mxc/asrc/mxc_asrc.c @@ -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;