[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <195fbcea-0b9d-4905-a131-78addcfff62b@linux.intel.com>
Date: Mon, 28 Apr 2025 09:39:43 +0200
From: Amadeusz Sławiński
<amadeuszx.slawinski@...ux.intel.com>
To: Thorsten Blum <thorsten.blum@...ux.dev>,
Cezary Rojewski <cezary.rojewski@...el.com>,
Liam Girdwood <liam.r.girdwood@...ux.intel.com>,
Peter Ujfalusi <peter.ujfalusi@...ux.intel.com>,
Bard Liao <yung-chuan.liao@...ux.intel.com>,
Ranjani Sridharan <ranjani.sridharan@...ux.intel.com>,
Kai Vehmanen <kai.vehmanen@...ux.intel.com>,
Pierre-Louis Bossart <pierre-louis.bossart@...ux.dev>,
Mark Brown <broonie@...nel.org>, Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>, Piotr Maziarz <piotrx.maziarz@...ux.intel.com>
Cc: linux-sound@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ASoC: Intel: avs: Fix kcalloc() sizes
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@...ux.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@...ux.intel.com>
Powered by blists - more mailing lists