MLK-16099-2: ASoc: fsl: length is not same for alloc and free memory
authorWeiguang Kong <weiguang.kong@nxp.com>
Mon, 31 Jul 2017 01:43:29 +0000 (09:43 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:36:12 +0000 (15:36 -0500)
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 <weiguang.kong@nxp.com>
sound/soc/fsl/fsl_hifi4.c

index e181880..bb8d694 100644 (file)
@@ -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);