From: Takashi Iwai Date: Sun, 7 Sep 2008 10:51:13 +0000 (+0200) Subject: ALSA: use correct lock in snd_ctl_dev_disconnect() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d8009882e9f5e1a76986c741f071edd2ad760c97;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git ALSA: use correct lock in snd_ctl_dev_disconnect() The lock used in snd_ctl_dev_disconnect() should be card->ctl_files_rwlock for protection of card->ctl_files entries, instead of card->controls_rwsem. Reported-by: Vegard Nossum Signed-off-by: Takashi Iwai Signed-off-by: Jaroslav Kysela --- diff --git a/sound/core/control.c b/sound/core/control.c index 3c5e746d619b..6d71f9a7ccbb 100644 --- a/sound/core/control.c +++ b/sound/core/control.c @@ -1438,12 +1438,12 @@ static int snd_ctl_dev_disconnect(struct snd_device *device) if (snd_BUG_ON(cardnum < 0 || cardnum >= SNDRV_CARDS)) return -ENXIO; - down_read(&card->controls_rwsem); + read_lock(&card->ctl_files_rwlock); list_for_each_entry(ctl, &card->ctl_files, list) { wake_up(&ctl->change_sleep); kill_fasync(&ctl->fasync, SIGIO, POLL_ERR); } - up_read(&card->controls_rwsem); + read_unlock(&card->ctl_files_rwlock); if ((err = snd_unregister_device(SNDRV_DEVICE_TYPE_CONTROL, card, -1)) < 0)