Skip to content

Commit 49d7615

Browse files
tiwaigregkh
authored andcommitted
ALSA: jack: Add missing rwsem around snd_ctl_remove() calls
[ Upstream commit 06764dc ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent f871cd8 commit 49d7615

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
@@ -54,10 +54,13 @@ static int snd_jack_dev_free(struct snd_device *device)
5454
struct snd_card *card = device->card;
5555
struct snd_jack_kctl *jack_kctl, *tmp_jack_kctl;
5656

57+
down_write(&card->controls_rwsem);
5758
list_for_each_entry_safe(jack_kctl, tmp_jack_kctl, &jack->kctl_list, list) {
5859
list_del_init(&jack_kctl->list);
5960
snd_ctl_remove(card, jack_kctl->kctl);
6061
}
62+
up_write(&card->controls_rwsem);
63+
6164
if (jack->private_free)
6265
jack->private_free(jack);
6366

0 commit comments

Comments
 (0)