[PATCH] sound: Fix incorrect calculation of object size by sizeof

Lu Hongfei posted 1 patch 2 years, 8 months ago
sound/soc/sof/ipc4-topology.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
mode change 100644 => 100755 sound/soc/sof/ipc4-topology.c
[PATCH] sound: Fix incorrect calculation of object size by sizeof
Posted by Lu Hongfei 2 years, 8 months ago
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 --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;
-- 
2.39.0
Re: [PATCH] sound: Fix incorrect calculation of object size by sizeof
Posted by Mark Brown 2 years, 8 months ago
On Tue, May 30, 2023 at 03:26:48PM +0800, Lu Hongfei wrote:

>  sound/soc/sof/ipc4-topology.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>  mode change 100644 => 100755 sound/soc/sof/ipc4-topology.c

Why is there a change in the file mode here?

Please submit patches using subject lines reflecting the style for the
subsystem, this makes it easier for people to identify relevant patches.
Look at what existing commits in the area you're changing are doing and
make sure your subject lines visually resemble what they're doing.
There's no need to resubmit to fix this alone.