diff options
author | Takashi Iwai <tiwai@suse.de> | 2008-09-07 06:51:13 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2008-09-09 03:11:48 -0400 |
commit | d8009882e9f5e1a76986c741f071edd2ad760c97 (patch) | |
tree | 7af54716fe7c5201acb3c2670a3047b3c6a2d5c9 /sound/core | |
parent | 3d8cb466a885cb5a0fb53ef3d39c36432d67fcbb (diff) |
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 <vegard.nossum@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/core')
-rw-r--r-- | sound/core/control.c | 4 |
1 files changed, 2 insertions, 2 deletions
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) | |||
1438 | if (snd_BUG_ON(cardnum < 0 || cardnum >= SNDRV_CARDS)) | 1438 | if (snd_BUG_ON(cardnum < 0 || cardnum >= SNDRV_CARDS)) |
1439 | return -ENXIO; | 1439 | return -ENXIO; |
1440 | 1440 | ||
1441 | down_read(&card->controls_rwsem); | 1441 | read_lock(&card->ctl_files_rwlock); |
1442 | list_for_each_entry(ctl, &card->ctl_files, list) { | 1442 | list_for_each_entry(ctl, &card->ctl_files, list) { |
1443 | wake_up(&ctl->change_sleep); | 1443 | wake_up(&ctl->change_sleep); |
1444 | kill_fasync(&ctl->fasync, SIGIO, POLL_ERR); | 1444 | kill_fasync(&ctl->fasync, SIGIO, POLL_ERR); |
1445 | } | 1445 | } |
1446 | up_read(&card->controls_rwsem); | 1446 | read_unlock(&card->ctl_files_rwlock); |
1447 | 1447 | ||
1448 | if ((err = snd_unregister_device(SNDRV_DEVICE_TYPE_CONTROL, | 1448 | if ((err = snd_unregister_device(SNDRV_DEVICE_TYPE_CONTROL, |
1449 | card, -1)) < 0) | 1449 | card, -1)) < 0) |