[PATCH] ASoC: Intel: avs: Fix d0ix reference count leak on set_params error path
From: WenTao Liang
Date: Thu Jun 11 2026 - 23:23:32 EST
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@xxxxxxxxxxxxxxx
Fixes: 700462f55493 ("ASoC: Intel: avs: Probe compress operations")
Signed-off-by: WenTao Liang <vulab@xxxxxxxxxxx>
---
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)