]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - sound/core/pcm.c
ALSA: fix locking in snd_pcm_open*() and snd_rawmidi_open*()
[linux-2.6-omap-h63xx.git] / sound / core / pcm.c
index 9dd9bc73fe1d6ab8b568fa1ce865650f52bae72f..ece25c718e95e8f78c5a71b01df6e01e80519908 100644 (file)
@@ -781,7 +781,7 @@ int snd_pcm_attach_substream(struct snd_pcm *pcm, int stream,
                return -ENODEV;
 
        card = pcm->card;
-       down_read(&card->controls_rwsem);
+       read_lock(&card->ctl_files_rwlock);
        list_for_each_entry(kctl, &card->ctl_files, list) {
                if (kctl->pid == current->pid) {
                        prefer_subdevice = kctl->prefer_pcm_subdevice;
@@ -789,7 +789,7 @@ int snd_pcm_attach_substream(struct snd_pcm *pcm, int stream,
                                break;
                }
        }
-       up_read(&card->controls_rwsem);
+       read_unlock(&card->ctl_files_rwlock);
 
        switch (stream) {
        case SNDRV_PCM_STREAM_PLAYBACK: