From: Ranjani Sridharan Date: Thu, 23 May 2019 17:12:01 +0000 (-0700) Subject: ASoC: core: lock client_mutex while removing link components X-Git-Tag: Ubuntu-5.2.0-15.16~1749^2~1^2~32 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=34ac3c3eb8f0c07252ceddf0a22dd240e5c91ccb;p=mirror_ubuntu-eoan-kernel.git ASoC: core: lock client_mutex while removing link components Removing link components results in topology unloading. So, acquire the client_mutex before removing components in soc_remove_link_components. This will prevent the lockdep warning seen when dai links are removed during topology removal. Signed-off-by: Ranjani Sridharan Signed-off-by: Mark Brown --- diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 2403bec2fccf..7c9415987ac7 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1005,12 +1005,14 @@ static void soc_remove_link_components(struct snd_soc_card *card, struct snd_soc_component *component; struct snd_soc_rtdcom_list *rtdcom; + mutex_lock(&client_mutex); for_each_rtdcom(rtd, rtdcom) { component = rtdcom->component; if (component->driver->remove_order == order) soc_remove_component(component); } + mutex_unlock(&client_mutex); } static void soc_remove_dai_links(struct snd_soc_card *card)