diff mbox series

sound: Fix incorrect calculation of object size by sizeof

Message ID 20230530072648.13998-1-luhongfei@vivo.com (mailing list archive)
State New, archived
Headers show
Series sound: Fix incorrect calculation of object size by sizeof | expand

Commit Message

Lu Hongfei May 30, 2023, 7:26 a.m. UTC
What we need to calculate is the size of the object, not the size of the
pointer. This patch can fix this error.

Signed-off-by: Lu Hongfei <luhongfei@vivo.com>
---
 sound/soc/sof/ipc4-topology.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
 mode change 100644 => 100755 sound/soc/sof/ipc4-topology.c
diff mbox series

Patch

diff --git a/sound/soc/sof/ipc4-topology.c b/sound/soc/sof/ipc4-topology.c
index 5abe616a2054..29b6dede53b0
--- a/sound/soc/sof/ipc4-topology.c
+++ b/sound/soc/sof/ipc4-topology.c
@@ -220,7 +220,7 @@  static int sof_ipc4_get_audio_fmt(struct snd_soc_component *scomp,
 
 	ret = sof_update_ipc_object(scomp, available_fmt,
 				    SOF_AUDIO_FMT_NUM_TOKENS, swidget->tuples,
-				    swidget->num_tuples, sizeof(available_fmt), 1);
+				    swidget->num_tuples, sizeof(*available_fmt), 1);
 	if (ret) {
 		dev_err(scomp->dev, "Failed to parse audio format token count\n");
 		return ret;