public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Amadeusz Sławiński" <amadeuszx.slawinski@linux.intel.com>
To: Thorsten Blum <thorsten.blum@linux.dev>,
	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>,
	Piotr Maziarz <piotrx.maziarz@linux.intel.com>
Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ASoC: Intel: avs: Fix kcalloc() sizes
Date: Mon, 28 Apr 2025 09:39:43 +0200	[thread overview]
Message-ID: <195fbcea-0b9d-4905-a131-78addcfff62b@linux.intel.com> (raw)
In-Reply-To: <20250426141342.94134-2-thorsten.blum@linux.dev>

On 2025-04-26 16:13, Thorsten Blum wrote:
> 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) {

Of course, thanks!

Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>


  reply	other threads:[~2025-04-28  7:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-26 14:13 [PATCH] ASoC: Intel: avs: Fix kcalloc() sizes Thorsten Blum
2025-04-28  7:39 ` Amadeusz Sławiński [this message]
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=195fbcea-0b9d-4905-a131-78addcfff62b@linux.intel.com \
    --to=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=thorsten.blum@linux.dev \
    --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