[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <95c39d93-f35f-4017-843e-e5d836f1b091@intel.com>
Date: Wed, 2 Apr 2025 15:59:41 +0200
From: Cezary Rojewski <cezary.rojewski@...el.com>
To: Henry Martin <bsdhenrymartin@...il.com>
CC: <amadeuszx.slawinski@...ux.intel.com>, <ethan@...ancedwards.com>,
<jbrunet@...libre.com>, <krzysztof.kozlowski@...aro.org>,
<linux-sound@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<liam.r.girdwood@...ux.intel.com>, <peter.ujfalusi@...ux.intel.com>,
<yung-chuan.liao@...ux.intel.com>, <ranjani.sridharan@...ux.intel.com>,
<kai.vehmanen@...ux.intel.com>, <pierre-louis.bossart@...ux.dev>,
<broonie@...nel.org>, <perex@...ex.cz>, <tiwai@...e.com>
Subject: Re: [PATCH v1] ASoC: Intel: avs: Add NULL check in
avs_component_probe()
On 2025-04-01 4:32 PM, Henry Martin wrote:
> devm_kasprintf() returns NULL when memory allocation fails. Currently,
> avs_component_probe() does not check for this case, which results in a
> NULL pointer dereference.
>
> Add NULL check after devm_kasprintf() to prevent this issue.
This basically repeats the title, I'd suggest to drop this very line. In
regard to the title, I believe:
ASoC: Intel: avs: Fix null-ptr-deref in avs_component_probe()
is more straightforward. That's what you're doing here afterall, fixing
stuff.
>
> Fixes: 739c031110da ("ASoC: Intel: avs: Provide support for fallback topology")
> Signed-off-by: Henry Martin <bsdhenrymartin@...il.com>
Good catch, thanks for sending the fix, Martin. I'm rather strict when
it comes to wording title/message but nothing more than a nitpick in
this case.
Whether you would be willing to provide v2 or not, feel free to add my tag:
Reviewed-by: Cezary Rojewski <cezary.rojewski@...el.com>
> ---
> sound/soc/intel/avs/pcm.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/sound/soc/intel/avs/pcm.c b/sound/soc/intel/avs/pcm.c
> index dac463390da1..7072bcf4e56f 100644
> --- a/sound/soc/intel/avs/pcm.c
> +++ b/sound/soc/intel/avs/pcm.c
> @@ -927,7 +927,8 @@ static int avs_component_probe(struct snd_soc_component *component)
> else
> mach->tplg_filename = devm_kasprintf(adev->dev, GFP_KERNEL,
> "hda-generic-tplg.bin");
> -
> + if (!mach->tplg_filename)
> + return -ENOMEM;
> filename = kasprintf(GFP_KERNEL, "%s/%s", component->driver->topology_name_prefix,
> mach->tplg_filename);
> if (!filename)
Powered by blists - more mailing lists