mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-28 13:22:57 +00:00
ASoC: topology: Add missing rwsem around snd_ctl_remove() calls
snd_ctl_remove() has to be called with card->controls_rwsem held (when
called after the card instantiation). This patch add the missing
rwsem calls around it.
Fixes: 8a9782346d
("ASoC: topology: Add topology core")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20211116071812.18109-1-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
6712c2e18c
commit
7e567b5ae0
1 changed files with 3 additions and 0 deletions
|
@ -2700,6 +2700,7 @@ EXPORT_SYMBOL_GPL(snd_soc_tplg_component_load);
|
||||||
/* remove dynamic controls from the component driver */
|
/* remove dynamic controls from the component driver */
|
||||||
int snd_soc_tplg_component_remove(struct snd_soc_component *comp)
|
int snd_soc_tplg_component_remove(struct snd_soc_component *comp)
|
||||||
{
|
{
|
||||||
|
struct snd_card *card = comp->card->snd_card;
|
||||||
struct snd_soc_dobj *dobj, *next_dobj;
|
struct snd_soc_dobj *dobj, *next_dobj;
|
||||||
int pass = SOC_TPLG_PASS_END;
|
int pass = SOC_TPLG_PASS_END;
|
||||||
|
|
||||||
|
@ -2707,6 +2708,7 @@ int snd_soc_tplg_component_remove(struct snd_soc_component *comp)
|
||||||
while (pass >= SOC_TPLG_PASS_START) {
|
while (pass >= SOC_TPLG_PASS_START) {
|
||||||
|
|
||||||
/* remove mixer controls */
|
/* remove mixer controls */
|
||||||
|
down_write(&card->controls_rwsem);
|
||||||
list_for_each_entry_safe(dobj, next_dobj, &comp->dobj_list,
|
list_for_each_entry_safe(dobj, next_dobj, &comp->dobj_list,
|
||||||
list) {
|
list) {
|
||||||
|
|
||||||
|
@ -2745,6 +2747,7 @@ int snd_soc_tplg_component_remove(struct snd_soc_component *comp)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
up_write(&card->controls_rwsem);
|
||||||
pass--;
|
pass--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue