ASoC: core: lock client_mutex while removing link components
authorRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Thu, 23 May 2019 17:12:01 +0000 (10:12 -0700)
committerMark Brown <broonie@kernel.org>
Fri, 24 May 2019 12:10:46 +0000 (13:10 +0100)
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 <ranjani.sridharan@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-core.c

index 2403bec2fccf35ad4b1752bba204454c4bd2b6cf..7c9415987ac76637d5be5f96c4353c107ce46d55 100644 (file)
@@ -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)