From ec6405ed15ddccb19edd32cad63f4cb5f3a1d8fe Mon Sep 17 00:00:00 2001 From: Weiguang Kong Date: Mon, 31 Jul 2017 09:43:29 +0800 Subject: [PATCH] MLK-16099-2: ASoc: fsl: length is not same for alloc and free memory In fsl_hifi4_probe(), the length for dma_alloc_coherent() is MSG_BUF_SIZE + INPUT_BUF_SIZE + OUTPUT_BUF_SIZE + FIRMWARE_DATA_BUF_SIZE + SCRATCH_DATA_BUF_SIZE; However, in fsl_hifi4_remove(), the length for dma_free_coherent() is MSG_BUF_SIZE + INPUT_BUF_SIZE + OUTPUT_BUF_SIZE + FIRMWARE_DATA_BUF_SIZE; By keeping the same length between dma_alloc_coherent() and dma_free_coherent() to fix this issue. Signed-off-by: Weiguang Kong --- sound/soc/fsl/fsl_hifi4.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sound/soc/fsl/fsl_hifi4.c b/sound/soc/fsl/fsl_hifi4.c index e1818809c32d..bb8d694c4fed 100644 --- a/sound/soc/fsl/fsl_hifi4.c +++ b/sound/soc/fsl/fsl_hifi4.c @@ -1705,7 +1705,8 @@ static int fsl_hifi4_remove(struct platform_device *pdev) misc_deregister(&hifi4_miscdev); size = MSG_BUF_SIZE + INPUT_BUF_SIZE + - OUTPUT_BUF_SIZE + FIRMWARE_DATA_BUF_SIZE; + OUTPUT_BUF_SIZE + FIRMWARE_DATA_BUF_SIZE + + SCRATCH_DATA_BUF_SIZE; dma_free_coherent(&pdev->dev, size, hifi4_priv->msg_buf_virt, hifi4_priv->msg_buf_phys); -- 2.17.1