Unverified Commit 84faa915 authored by Ziyi Guo's avatar Ziyi Guo Committed by Mark Brown
Browse files

ASoC: fsl: imx-rpmsg: use snd_soc_find_dai_with_mutex() in probe



imx_rpmsg_probe() calls snd_soc_find_dai() without holding client_mutex.
However, snd_soc_find_dai() has lockdep_assert_held(&client_mutex)
indicating callers must hold this lock, as the function iterates over the
global component list.

All other callers of snd_soc_find_dai() either hold client_mutex via the
snd_soc_bind_card() path or use the snd_soc_find_dai_with_mutex() wrapper.

Use snd_soc_find_dai_with_mutex() instead to fix the missing lock
protection.

Signed-off-by: default avatarZiyi Guo <n7l8m4@u.northwestern.edu>
Reviewed-by: default avatarFrank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260205052429.4046903-1-n7l8m4@u.northwestern.edu


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent fef1f756
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -145,7 +145,7 @@ static int imx_rpmsg_probe(struct platform_device *pdev)
	data->dai.ignore_pmdown_time = 1;

	data->dai.cpus->dai_name = pdev->dev.platform_data;
	cpu_dai = snd_soc_find_dai(data->dai.cpus);
	cpu_dai = snd_soc_find_dai_with_mutex(data->dai.cpus);
	if (!cpu_dai) {
		ret = -EPROBE_DEFER;
		goto fail;