Re: [PATCH] ASoC: samsung: i2s: Fix runtime PM usage count leak on failed trigger
From: Mark Brown
Date: Fri Nov 06 2026 - 09:58:40 EST
> i2s_trigger() calls pm_runtime_get_sync() when the stream is started,
> but if config_setup() fails it returns -EINVAL directly without
> dropping the reference. The matching pm_runtime_put() only runs in
> the STOP path.
> @@ -936,7 +936,7 @@ static int i2s_trigger(struct snd_pcm_substream *substream,
>
> scoped_guard(spinlock_irqsave, &priv->lock) {
> if (config_setup(i2s))
> - return -EINVAL;
> + goto err_put;
This mixes scoped_guard and goto, that is prone to breakage.
> +err_put:
> + pm_runtime_put(dai->dev);
If the subsream is not linked then the core will unwind th start which
does actually do the trigger() the commit message said won't happen...
--
Mark Brown <broonie@xxxxxxxxxx>