* [PATCH] ASoC: sdw_utils: fix double put_device() on aggregated amps
@ 2026-08-18 2:30 jack.yu
2026-08-18 17:31 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: jack.yu @ 2026-08-18 2:30 UTC (permalink / raw)
To: broonie, lgirdwood
Cc: alsa-devel, lars, flove, oder_chiou, shumingf, derek.fang,
Trevor.Wu, Jack Yu
From: Jack Yu <jack.yu@realtek.com>
In aggregation mode with two identical amplifiers,
a stress test that repeatedly triggers card unbind/rebind
can hit a NULL pointer dereference during the exit path.
ctx->amp_dev1 / ctx->amp_dev2 are single shared resources,
so the release must be safe against being called more than once.
Clear each pointer after put_device() so a second invocation
becomes a no-op, this could address NULL pointer dereference issue.
Signed-off-by: Jack Yu <jack.yu@realtek.com>
---
sound/soc/sdw_utils/soc_sdw_rt_amp.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/soc/sdw_utils/soc_sdw_rt_amp.c b/sound/soc/sdw_utils/soc_sdw_rt_amp.c
index 4e9b08cb653d..81d2cbac0ea3 100644
--- a/sound/soc/sdw_utils/soc_sdw_rt_amp.c
+++ b/sound/soc/sdw_utils/soc_sdw_rt_amp.c
@@ -252,11 +252,13 @@ int asoc_sdw_rt_amp_exit(struct snd_soc_card *card, struct snd_soc_dai_link *dai
if (ctx->amp_dev1) {
device_remove_software_node(ctx->amp_dev1);
put_device(ctx->amp_dev1);
+ ctx->amp_dev1 = NULL;
}
if (ctx->amp_dev2) {
device_remove_software_node(ctx->amp_dev2);
put_device(ctx->amp_dev2);
+ ctx->amp_dev2 = NULL;
}
return 0;
--
2.54.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] ASoC: sdw_utils: fix double put_device() on aggregated amps
2026-08-18 2:30 [PATCH] ASoC: sdw_utils: fix double put_device() on aggregated amps jack.yu
@ 2026-08-18 17:31 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2026-08-18 17:31 UTC (permalink / raw)
To: lgirdwood, jack.yu
Cc: alsa-devel, lars, flove, oder_chiou, shumingf, derek.fang,
Trevor.Wu
On Tue, 18 Aug 2026 10:30:18 +0800, jack.yu@realtek.com wrote:
> ASoC: sdw_utils: fix double put_device() on aggregated amps
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.3
Thanks!
[1/1] ASoC: sdw_utils: fix double put_device() on aggregated amps
https://git.kernel.org/broonie/sound/c/046173b98de3
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] 2+ messages in thread
end of thread, other threads:[~2026-08-18 20:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-18 2:30 [PATCH] ASoC: sdw_utils: fix double put_device() on aggregated amps jack.yu
2026-08-18 17:31 ` Mark Brown
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.