mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ASoC: Intel: avs: Fix d0ix reference count leak on set_params error path
@ 2026-06-12  3:22 WenTao Liang
  2026-06-18 15:55 ` Cezary Rojewski
  0 siblings, 1 reply; 2+ messages in thread
From: WenTao Liang @ 2026-06-12  3:22 UTC (permalink / raw)
  To: cezary.rojewski, liam.r.girdwood, peter.ujfalusi,
	yung-chuan.liao, kai.vehmanen, broonie, perex, tiwai
  Cc: pierre-louis.bossart, amadeuszx.slawinski, songxiebing,
	verhaegen, vulab, linux-sound, linux-kernel, stable

In avs_probe_compr_set_params(), avs_dsp_disable_d0ix() is called when
no probe streams are active. This function atomically increments the
d0ix_disable_depth counter before attempting the hardware power state
transition. If the transition (avs_dsp_set_d0ix()) fails, the function
returns an error but the counter remains elevated.

The caller does not balance the counter on this error path, causing a
reference count leak that permanently prevents the DSP from entering
d0ix.

Fix the leak by calling avs_dsp_enable_d0ix() to balance the previous
disable call before returning the error, mirroring the existing cleanup
pattern used when avs_dsp_init_probe() fails.

Cc: stable@vger.kernel.org
Fixes: 700462f55493 ("ASoC: Intel: avs: Probe compress operations")
Signed-off-by: WenTao Liang <vulab@iscas.ac.cn>
---
 sound/soc/intel/avs/probes.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sound/soc/intel/avs/probes.c b/sound/soc/intel/avs/probes.c
index 099119ad28b3..01d9421cf9ab 100644
--- a/sound/soc/intel/avs/probes.c
+++ b/sound/soc/intel/avs/probes.c
@@ -162,8 +162,10 @@ static int avs_probe_compr_set_params(struct snd_compr_stream *cstream,
 
 		/* D0ix not allowed during probing. */
 		ret = avs_dsp_disable_d0ix(adev);
-		if (ret)
+		if (ret) {
+			avs_dsp_enable_d0ix(adev);
 			return ret;
+		}
 
 		node_id.vindex = hdac_stream(host_stream)->stream_tag - 1;
 		node_id.dma_type = AVS_DMA_HDA_HOST_INPUT;
-- 
2.50.1 (Apple Git-155)


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-06-18 15:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-12  3:22 [PATCH] ASoC: Intel: avs: Fix d0ix reference count leak on set_params error path WenTao Liang
2026-06-18 15:55 ` Cezary Rojewski

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®