Re: [PATCH next] ASoC: SOF: Intel: hda-dai: Fix locking in hda_ipc4_pre_trigger()

From: Ranjani Sridharan
Date: Mon May 22 2023 - 16:29:33 EST


On Thu, 2023-05-18 at 23:44 -0700, Harshit Mogalapalli wrote:
> hda_ipc4_pre_trigger() has two issues:
> 1. In the default case, we are returning without unlocking the
> mutex.
> 2. In case SNDRV_PCM_TRIGGER_STOP: when ret is less than zero it
> goes
> to out, unlocks but returns zero instead of a negative value.
>
> Fix this by changing the final return value to 'ret' instead of zero,
> and initialize 'ret' to zero in the start of the function.
>
> Fixes: 225f37b578a9 ("ASoC: SOF: ipc4-pcm: reset all pipelines during
> FE DAI hw_free")
> Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@xxxxxxxxxx>
> ---
> Only compile tested. This is found using static anlysis with Smatch.
> ---
Thanks for this fix. LGTM.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@xxxxxxxxxxxxxxx>