From: Thorsten Blum <thorsten.blum@linux.dev>
To: "Cezary Rojewski" <cezary.rojewski@intel.com>,
"Liam Girdwood" <liam.r.girdwood@linux.intel.com>,
"Peter Ujfalusi" <peter.ujfalusi@linux.intel.com>,
"Bard Liao" <yung-chuan.liao@linux.intel.com>,
"Ranjani Sridharan" <ranjani.sridharan@linux.intel.com>,
"Kai Vehmanen" <kai.vehmanen@linux.intel.com>,
"Pierre-Louis Bossart" <pierre-louis.bossart@linux.dev>,
"Mark Brown" <broonie@kernel.org>,
"Jaroslav Kysela" <perex@perex.cz>,
"Takashi Iwai" <tiwai@suse.com>,
"Amadeusz Sławiński" <amadeuszx.slawinski@linux.intel.com>,
"Piotr Maziarz" <piotrx.maziarz@linux.intel.com>
Cc: Thorsten Blum <thorsten.blum@linux.dev>,
linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] ASoC: Intel: avs: Fix kcalloc() sizes
Date: Sat, 26 Apr 2025 16:13:41 +0200 [thread overview]
Message-ID: <20250426141342.94134-2-thorsten.blum@linux.dev> (raw)
rlist, clist, and slist are allocated using sizeof(pointer) instead of
sizeof(*pointer). Fix the allocations by using sizeof(*pointer) and
avoid overallocating memory on 64-bit systems.
Fixes: f2f847461fb7 ("ASoC: Intel: avs: Constrain path based on BE capabilities")
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
sound/soc/intel/avs/path.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sound/soc/intel/avs/path.c b/sound/soc/intel/avs/path.c
index cafb8c6198be..8f1bf8d0af8f 100644
--- a/sound/soc/intel/avs/path.c
+++ b/sound/soc/intel/avs/path.c
@@ -131,9 +131,9 @@ int avs_path_set_constraint(struct avs_dev *adev, struct avs_tplg_path_template
list_for_each_entry(path_template, &template->path_list, node)
i++;
- rlist = kcalloc(i, sizeof(rlist), GFP_KERNEL);
- clist = kcalloc(i, sizeof(clist), GFP_KERNEL);
- slist = kcalloc(i, sizeof(slist), GFP_KERNEL);
+ rlist = kcalloc(i, sizeof(*rlist), GFP_KERNEL);
+ clist = kcalloc(i, sizeof(*clist), GFP_KERNEL);
+ slist = kcalloc(i, sizeof(*slist), GFP_KERNEL);
i = 0;
list_for_each_entry(path_template, &template->path_list, node) {
--
2.49.0
next reply other threads:[~2025-04-26 14:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-26 14:13 Thorsten Blum [this message]
2025-04-28 7:39 ` [PATCH] ASoC: Intel: avs: Fix kcalloc() sizes Amadeusz Sławiński
2025-05-01 5:43 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250426141342.94134-2-thorsten.blum@linux.dev \
--to=thorsten.blum@linux.dev \
--cc=amadeuszx.slawinski@linux.intel.com \
--cc=broonie@kernel.org \
--cc=cezary.rojewski@intel.com \
--cc=kai.vehmanen@linux.intel.com \
--cc=liam.r.girdwood@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=peter.ujfalusi@linux.intel.com \
--cc=pierre-louis.bossart@linux.dev \
--cc=piotrx.maziarz@linux.intel.com \
--cc=ranjani.sridharan@linux.intel.com \
--cc=tiwai@suse.com \
--cc=yung-chuan.liao@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox