* [PATCH] ASoC: Intel: sof_sdw: Add NULL check in asoc_sdw_rt_dmic_rtd_init()
@ 2025-04-15 19:41 Chenyuan Yang
2025-04-16 7:19 ` Markus Elfring
2025-04-16 14:23 ` Mark Brown
0 siblings, 2 replies; 4+ messages in thread
From: Chenyuan Yang @ 2025-04-15 19:41 UTC (permalink / raw)
To: lgirdwood, broonie, perex, tiwai, yung-chuan.liao,
pierre-louis.bossart, Vijendar.Mukunda, peter.ujfalusi, peterz,
chao.song
Cc: linux-sound, linux-kernel, Chenyuan Yang
mic_name returned by devm_kasprintf() could be NULL.
Add a check for it.
Signed-off-by: Chenyuan Yang <chenyuan0y@gmail.com>
Fixes: bee2fe44679f ("ASoC: Intel: sof_sdw: use generic rtd_init function for Realtek SDW DMICs")
---
sound/soc/sdw_utils/soc_sdw_rt_dmic.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/soc/sdw_utils/soc_sdw_rt_dmic.c b/sound/soc/sdw_utils/soc_sdw_rt_dmic.c
index 46d917a99c51..97be110a59b6 100644
--- a/sound/soc/sdw_utils/soc_sdw_rt_dmic.c
+++ b/sound/soc/sdw_utils/soc_sdw_rt_dmic.c
@@ -29,6 +29,8 @@ int asoc_sdw_rt_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_da
mic_name = devm_kasprintf(card->dev, GFP_KERNEL, "rt715-sdca");
else
mic_name = devm_kasprintf(card->dev, GFP_KERNEL, "%s", component->name_prefix);
+ if (!mic_name)
+ return -ENOMEM;
card->components = devm_kasprintf(card->dev, GFP_KERNEL,
"%s mic:%s", card->components,
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] ASoC: Intel: sof_sdw: Add NULL check in asoc_sdw_rt_dmic_rtd_init()
2025-04-15 19:41 [PATCH] ASoC: Intel: sof_sdw: Add NULL check in asoc_sdw_rt_dmic_rtd_init() Chenyuan Yang
@ 2025-04-16 7:19 ` Markus Elfring
2025-04-16 11:19 ` Mark Brown
2025-04-16 14:23 ` Mark Brown
1 sibling, 1 reply; 4+ messages in thread
From: Markus Elfring @ 2025-04-16 7:19 UTC (permalink / raw)
To: Chenyuan Yang, linux-sound
Cc: LKML, Bard Liao, Chao Song, Jaroslav Kysela, Liam Girdwood,
Mark Brown, Peter Ujfalusi, Peter Zijlstra, Pierre-Louis Bossart,
Takashi Iwai, Vijendar Mukunda
> mic_name returned by devm_kasprintf() could be NULL.
> Add a check for it.
Was this patch also supported by the source code analysis tool “KNighter”?
…
> +++ b/sound/soc/sdw_utils/soc_sdw_rt_dmic.c
> @@ -29,6 +29,8 @@ int asoc_sdw_rt_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_da
> mic_name = devm_kasprintf(card->dev, GFP_KERNEL, "rt715-sdca");
> else
> mic_name = devm_kasprintf(card->dev, GFP_KERNEL, "%s", component->name_prefix);
…
How do you think about to use the function “devm_kstrdup” in one if branch instead
(by another update step)?
https://elixir.bootlin.com/linux/v6.14-rc6/source/drivers/base/devres.c#L958-L965
Regards,
Markus
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ASoC: Intel: sof_sdw: Add NULL check in asoc_sdw_rt_dmic_rtd_init()
2025-04-16 7:19 ` Markus Elfring
@ 2025-04-16 11:19 ` Mark Brown
0 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2025-04-16 11:19 UTC (permalink / raw)
To: Markus Elfring
Cc: Chenyuan Yang, linux-sound, LKML, Bard Liao, Chao Song,
Jaroslav Kysela, Liam Girdwood, Peter Ujfalusi, Peter Zijlstra,
Pierre-Louis Bossart, Takashi Iwai, Vijendar Mukunda
[-- Attachment #1: Type: text/plain, Size: 377 bytes --]
On Wed, Apr 16, 2025 at 09:19:12AM +0200, Markus Elfring wrote:
> > mic_name returned by devm_kasprintf() could be NULL.
> > Add a check for it.
>
> Was this patch also supported by the source code analysis tool “KNighter”?
Feel free to ignore Markus, he has a long history of sending
unhelpful review comments and continues to ignore repeated requests
to stop.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ASoC: Intel: sof_sdw: Add NULL check in asoc_sdw_rt_dmic_rtd_init()
2025-04-15 19:41 [PATCH] ASoC: Intel: sof_sdw: Add NULL check in asoc_sdw_rt_dmic_rtd_init() Chenyuan Yang
2025-04-16 7:19 ` Markus Elfring
@ 2025-04-16 14:23 ` Mark Brown
1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2025-04-16 14:23 UTC (permalink / raw)
To: lgirdwood, perex, tiwai, yung-chuan.liao, pierre-louis.bossart,
Vijendar.Mukunda, peter.ujfalusi, peterz, chao.song,
Chenyuan Yang
Cc: linux-sound, linux-kernel
On Tue, 15 Apr 2025 14:41:34 -0500, Chenyuan Yang wrote:
> mic_name returned by devm_kasprintf() could be NULL.
> Add a check for it.
>
>
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/1] ASoC: Intel: sof_sdw: Add NULL check in asoc_sdw_rt_dmic_rtd_init()
commit: 68715cb5c0e00284d93f976c6368809f64131b0b
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-04-16 14:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-15 19:41 [PATCH] ASoC: Intel: sof_sdw: Add NULL check in asoc_sdw_rt_dmic_rtd_init() Chenyuan Yang
2025-04-16 7:19 ` Markus Elfring
2025-04-16 11:19 ` Mark Brown
2025-04-16 14:23 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox