Skip to content

Commit 80bd64a

Browse files
committed
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: d13bd41 ("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>
1 parent 5471e97 commit 80bd64a

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

sound/pci/hda/hda_codec.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1727,8 +1727,11 @@ void snd_hda_ctls_clear(struct hda_codec *codec)
17271727
{
17281728
int i;
17291729
struct hda_nid_item *items = codec->mixers.list;
1730+
1731+
down_write(&codec->card->controls_rwsem);
17301732
for (i = 0; i < codec->mixers.used; i++)
17311733
snd_ctl_remove(codec->card, items[i].kctl);
1734+
up_write(&codec->card->controls_rwsem);
17321735
snd_array_free(&codec->mixers);
17331736
snd_array_free(&codec->nids);
17341737
}

0 commit comments

Comments
 (0)