diff options
-rw-r--r-- | sound/core/control.c | 2 | ||||
-rw-r--r-- | sound/core/pcm.c | 3 | ||||
-rw-r--r-- | sound/core/rawmidi.c | 3 |
3 files changed, 6 insertions, 2 deletions
diff --git a/sound/core/control.c b/sound/core/control.c index 31ad581..ac14426 100644 --- a/sound/core/control.c +++ b/sound/core/control.c @@ -75,6 +75,8 @@ static int snd_ctl_open(struct inode *inode, struct file *file) init_waitqueue_head(&ctl->change_sleep); spin_lock_init(&ctl->read_lock); ctl->card = card; + ctl->prefer_pcm_subdevice = -1; + ctl->prefer_rawmidi_subdevice = -1; ctl->pid = current->pid; file->private_data = ctl; write_lock_irqsave(&card->ctl_files_rwlock, flags); diff --git a/sound/core/pcm.c b/sound/core/pcm.c index f52178a..ed3b094 100644 --- a/sound/core/pcm.c +++ b/sound/core/pcm.c @@ -792,7 +792,8 @@ int snd_pcm_attach_substream(struct snd_pcm *pcm, int stream, kctl = snd_ctl_file(list); if (kctl->pid == current->pid) { prefer_subdevice = kctl->prefer_pcm_subdevice; - break; + if (prefer_subdevice != -1) + break; } } up_read(&card->controls_rwsem); diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c index 8a2bdfa..269c467 100644 --- a/sound/core/rawmidi.c +++ b/sound/core/rawmidi.c @@ -430,7 +430,8 @@ static int snd_rawmidi_open(struct inode *inode, struct file *file) kctl = snd_ctl_file(list); if (kctl->pid == current->pid) { subdevice = kctl->prefer_rawmidi_subdevice; - break; + if (subdevice != -1) + break; } } up_read(&card->controls_rwsem); |