diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2009-11-02 03:35:44 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-11-06 08:32:06 -0500 |
commit | 25d27eded1f4fc728e64f443adc339b5229be5d7 (patch) | |
tree | b738266467fc0f85d9f7f29e439dfff8e33da4c0 /sound/core/pcm.c | |
parent | 31cef7076ed9409a33f19ea372d6dc5fdefe27ae (diff) |
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/pcm.c')
-rw-r--r-- | sound/core/pcm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/core/pcm.c b/sound/core/pcm.c index c69c60b2a48a..8e2c7833614c 100644 --- a/sound/core/pcm.c +++ b/sound/core/pcm.c | |||
@@ -809,7 +809,7 @@ int snd_pcm_attach_substream(struct snd_pcm *pcm, int stream, | |||
809 | card = pcm->card; | 809 | card = pcm->card; |
810 | read_lock(&card->ctl_files_rwlock); | 810 | read_lock(&card->ctl_files_rwlock); |
811 | list_for_each_entry(kctl, &card->ctl_files, list) { | 811 | list_for_each_entry(kctl, &card->ctl_files, list) { |
812 | if (kctl->pid == current->pid) { | 812 | if (kctl->pid == task_pid(current)) { |
813 | prefer_subdevice = kctl->prefer_pcm_subdevice; | 813 | prefer_subdevice = kctl->prefer_pcm_subdevice; |
814 | if (prefer_subdevice != -1) | 814 | if (prefer_subdevice != -1) |
815 | break; | 815 | break; |