* [PATCH] ASoC: amd: acp3x-rt5682-max9836: Add missing error check for clock acquisition
@ 2026-03-10 2:42 Chen Ni
2026-03-10 12:05 ` Markus Elfring
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Chen Ni @ 2026-03-10 2:42 UTC (permalink / raw)
To: Vijendar.Mukunda, venkataprasad.potturu
Cc: lgirdwood, broonie, perex, tiwai, akshu.agrawal, linux-sound,
linux-kernel, Chen Ni
The acp3x_5682_init() function did not check the return value of
clk_get(), which could lead to dereferencing error pointers in
rt5682_clk_enable().
Fix this by:
1. Changing clk_get() to the device-managed devm_clk_get().
2. Adding proper IS_ERR() checks for both clock acquisitions.
Fixes: 6b8e4e7db3cd ("ASoC: amd: Add machine driver for Raven based platform")
Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
---
sound/soc/amd/acp3x-rt5682-max9836.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/sound/soc/amd/acp3x-rt5682-max9836.c b/sound/soc/amd/acp3x-rt5682-max9836.c
index 4ca1978020a9..d1eb6f12a183 100644
--- a/sound/soc/amd/acp3x-rt5682-max9836.c
+++ b/sound/soc/amd/acp3x-rt5682-max9836.c
@@ -94,8 +94,13 @@ static int acp3x_5682_init(struct snd_soc_pcm_runtime *rtd)
return ret;
}
- rt5682_dai_wclk = clk_get(component->dev, "rt5682-dai-wclk");
- rt5682_dai_bclk = clk_get(component->dev, "rt5682-dai-bclk");
+ rt5682_dai_wclk = devm_clk_get(component->dev, "rt5682-dai-wclk");
+ if (IS_ERR(rt5682_dai_wclk))
+ return PTR_ERR(rt5682_dai_wclk);
+
+ rt5682_dai_bclk = devm_clk_get(component->dev, "rt5682-dai-bclk");
+ if (IS_ERR(rt5682_dai_bclk))
+ return PTR_ERR(rt5682_dai_bclk);
ret = snd_soc_card_jack_new_pins(card, "Headset Jack",
SND_JACK_HEADSET |
--
2.25.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ASoC: amd: acp3x-rt5682-max9836: Add missing error check for clock acquisition
2026-03-10 2:42 [PATCH] ASoC: amd: acp3x-rt5682-max9836: Add missing error check for clock acquisition Chen Ni
@ 2026-03-10 12:05 ` Markus Elfring
2026-03-11 18:56 ` Mark Brown
2026-03-14 21:58 ` Mark Brown
2 siblings, 0 replies; 4+ messages in thread
From: Markus Elfring @ 2026-03-10 12:05 UTC (permalink / raw)
To: Chen Ni, linux-sound, Venkata Prasad Potturu, Vijendar Mukunda
Cc: LKML, Akshu Agrawal, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai
…
> Fix this by:
> 1. Changing clk_get() to the device-managed devm_clk_get().
> 2. Adding proper IS_ERR() checks for both clock acquisitions.
Do any contributors care any more for further patch requirements?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v7.0-rc3#n94
Regards,
Markus
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ASoC: amd: acp3x-rt5682-max9836: Add missing error check for clock acquisition
2026-03-10 2:42 [PATCH] ASoC: amd: acp3x-rt5682-max9836: Add missing error check for clock acquisition Chen Ni
2026-03-10 12:05 ` Markus Elfring
@ 2026-03-11 18:56 ` Mark Brown
2026-03-14 21:58 ` Mark Brown
2 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2026-03-11 18:56 UTC (permalink / raw)
To: Vijendar.Mukunda, venkataprasad.potturu, Chen Ni
Cc: lgirdwood, perex, tiwai, akshu.agrawal, linux-sound, linux-kernel
On Tue, 10 Mar 2026 10:42:46 +0800, Chen Ni wrote:
> The acp3x_5682_init() function did not check the return value of
> clk_get(), which could lead to dereferencing error pointers in
> rt5682_clk_enable().
>
> Fix this by:
> 1. Changing clk_get() to the device-managed devm_clk_get().
> 2. Adding proper IS_ERR() checks for both clock acquisitions.
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/1] ASoC: amd: acp3x-rt5682-max9836: Add missing error check for clock acquisition
commit: 53f3a900e9a383d47af7253076e19f510c5708d0
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
* Re: [PATCH] ASoC: amd: acp3x-rt5682-max9836: Add missing error check for clock acquisition
2026-03-10 2:42 [PATCH] ASoC: amd: acp3x-rt5682-max9836: Add missing error check for clock acquisition Chen Ni
2026-03-10 12:05 ` Markus Elfring
2026-03-11 18:56 ` Mark Brown
@ 2026-03-14 21:58 ` Mark Brown
2 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2026-03-14 21:58 UTC (permalink / raw)
To: Vijendar.Mukunda, venkataprasad.potturu, Chen Ni
Cc: lgirdwood, perex, tiwai, akshu.agrawal, linux-sound, linux-kernel
On Tue, 10 Mar 2026 10:42:46 +0800, Chen Ni wrote:
> ASoC: amd: acp3x-rt5682-max9836: Add missing error check for clock acquisition
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.0
Thanks!
[1/1] ASoC: amd: acp3x-rt5682-max9836: Add missing error check for clock acquisition
https://git.kernel.org/broonie/misc/c/53f3a900e9a3
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:[~2026-03-16 1:38 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-03-10 2:42 [PATCH] ASoC: amd: acp3x-rt5682-max9836: Add missing error check for clock acquisition Chen Ni
2026-03-10 12:05 ` Markus Elfring
2026-03-11 18:56 ` Mark Brown
2026-03-14 21:58 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®