[Sound-open-firmware] [PATCH] dmic: fix size while copying DMIC params

Ranjani Sridharan ranjani.sridharan at linux.intel.com
Thu Jun 14 19:45:57 CEST 2018


The size argument for memcpy should be sizeof struct
sof_ipc_dai_dmic_params.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan at linux.intel.com>
---
 src/drivers/dmic.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/drivers/dmic.c b/src/drivers/dmic.c
index b66769c..97ca8b2 100644
--- a/src/drivers/dmic.c
+++ b/src/drivers/dmic.c
@@ -1032,8 +1032,8 @@ static int dmic_set_config(struct dai *dai, struct sof_ipc_dai_config *config)
 		* sizeof(struct sof_ipc_dai_dmic_pdm_ctrl);
 	prm = rzalloc(RZONE_SYS, SOF_MEM_CAPS_RAM, size);
 
-	/* copy the command DAI config params and DMIC params */
-	memcpy(prm, &config->dmic, sizeof(struct sof_ipc_dai_config));
+	/* copy the DMIC params */
+	memcpy(prm, &config->dmic, sizeof(struct sof_ipc_dai_dmic_params));
 
 	/* copy the pdm controller params from ipc */
 	for (i = 0; i < DMIC_HW_CONTROLLERS; i++) {
-- 
2.17.1



More information about the Sound-open-firmware mailing list