Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: hda: 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: d13bd412dce2 ("ALSA: hda - Manage kcontrol lists")
Link: https://lore.kernel.org/r/20211116071314.15065-3-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>

+3
+3
sound/pci/hda/hda_codec.c
··· 1727 1727 { 1728 1728 int i; 1729 1729 struct hda_nid_item *items = codec->mixers.list; 1730 + 1731 + down_write(&codec->card->controls_rwsem); 1730 1732 for (i = 0; i < codec->mixers.used; i++) 1731 1733 snd_ctl_remove(codec->card, items[i].kctl); 1734 + up_write(&codec->card->controls_rwsem); 1732 1735 snd_array_free(&codec->mixers); 1733 1736 snd_array_free(&codec->nids); 1734 1737 }