summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2008-09-07 12:51:13 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2008-11-06 19:05:47 -0800
commit2036d699628785c4f489384a40b121a5dcb771eb (patch)
treeab1a1b627e7e5b3ca072ca0f72b5e2f748ad3a7e
parent8a282dc975d9550850232759b6211eb6019a7b06 (diff)
ALSA: use correct lock in snd_ctl_dev_disconnect()
commit d8009882e9f5e1a76986c741f071edd2ad760c97 upstream 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 <vegard.nossum@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz> Cc: Chris Wedgwood <cw@f00f.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--sound/core/control.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/core/control.c b/sound/core/control.c
index 281b2e2ef0ea..236bbb15b250 100644
--- a/sound/core/control.c
+++ b/sound/core/control.c
@@ -1427,12 +1427,12 @@ static int snd_ctl_dev_disconnect(struct snd_device *device)
cardnum = card->number;
snd_assert(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)