summaryrefslogtreecommitdiff
path: root/sound/core/rawmidi.c
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2009-11-02 11:35:44 +0300
committerTakashi Iwai <tiwai@suse.de>2009-11-06 16:32:06 +0300
commit25d27eded1f4fc728e64f443adc339b5229be5d7 (patch)
treeb738266467fc0f85d9f7f29e439dfff8e33da4c0 /sound/core/rawmidi.c
parent31cef7076ed9409a33f19ea372d6dc5fdefe27ae (diff)
downloadlinux-25d27eded1f4fc728e64f443adc339b5229be5d7.tar.xz
control: use reference-counted pid
Instead of storing the PID number, take a reference to the task's pid structure. This protects against duplicates due to PID overflows, and using pid_vnr() ensures that the PID returned by snd_ctl_elem_info() is correct as seen from the current namespace. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core/rawmidi.c')
-rw-r--r--sound/core/rawmidi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c
index c0adc14c91f0..8a81bdafce6e 100644
--- a/sound/core/rawmidi.c
+++ b/sound/core/rawmidi.c
@@ -415,7 +415,7 @@ static int snd_rawmidi_open(struct inode *inode, struct file *file)
subdevice = -1;
read_lock(&card->ctl_files_rwlock);
list_for_each_entry(kctl, &card->ctl_files, list) {
- if (kctl->pid == current->pid) {
+ if (kctl->pid == task_pid(current)) {
subdevice = kctl->prefer_rawmidi_subdevice;
if (subdevice != -1)
break;