Skip to content

Commit 06764dc

Browse files
committed
ALSA: jack: 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: 9058cbe ("ALSA: jack: implement kctl creating for jack devices") Link: https://lore.kernel.org/r/20211116071314.15065-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 02eb1d0 commit 06764dc

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

sound/core/jack.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,13 @@ static int snd_jack_dev_free(struct snd_device *device)
6262
struct snd_card *card = device->card;
6363
struct snd_jack_kctl *jack_kctl, *tmp_jack_kctl;
6464

65+
down_write(&card->controls_rwsem);
6566
list_for_each_entry_safe(jack_kctl, tmp_jack_kctl, &jack->kctl_list, list) {
6667
list_del_init(&jack_kctl->list);
6768
snd_ctl_remove(card, jack_kctl->kctl);
6869
}
70+
up_write(&card->controls_rwsem);
71+
6972
if (jack->private_free)
7073
jack->private_free(jack);
7174

0 commit comments

Comments
 (0)