summaryrefslogtreecommitdiff
path: root/drivers/staging
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2021-11-16 10:20:27 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-12-01 11:04:41 +0300
commitf0340bea83020c09bd1661e472d5068fb1570888 (patch)
tree0f3516d86b2822b02557e81dbb9a318e100d71ff /drivers/staging
parentd58ec6e81803e679a838f20acdcbb4e7a23e308f (diff)
downloadlinux-f0340bea83020c09bd1661e472d5068fb1570888.tar.xz
staging: greybus: Add missing rwsem around snd_ctl_remove() calls
commit ffcf7ae90f4489047d7b076539ba207024dea5f6 upstream. snd_ctl_remove() has to be called with card->controls_rwsem held (when called after the card instantiation). This patch adds the missing rwsem calls around it. Fixes: 510e340efe0c ("staging: greybus: audio: Add helper APIs for dynamic audio modules") Cc: stable <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20211116072027.18466-1-tiwai@suse.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/greybus/audio_helper.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/staging/greybus/audio_helper.c b/drivers/staging/greybus/audio_helper.c
index 1ed4772d2771..843760675876 100644
--- a/drivers/staging/greybus/audio_helper.c
+++ b/drivers/staging/greybus/audio_helper.c
@@ -192,7 +192,11 @@ int gbaudio_remove_component_controls(struct snd_soc_component *component,
unsigned int num_controls)
{
struct snd_card *card = component->card->snd_card;
+ int err;
- return gbaudio_remove_controls(card, component->dev, controls,
- num_controls, component->name_prefix);
+ down_write(&card->controls_rwsem);
+ err = gbaudio_remove_controls(card, component->dev, controls,
+ num_controls, component->name_prefix);
+ up_write(&card->controls_rwsem);
+ return err;
}