Skip to content

Commit

Permalink
[IA64] make pfm_get_task work with virtual pids
Browse files Browse the repository at this point in the history
This pid comes from user space, so treat it accordingly.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Tony Luck <tony.luck@intel.com>
  • Loading branch information
Pavel Emelyanov authored and Tony Luck committed Feb 5, 2008
1 parent 620de2f commit e1b0d4b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/ia64/kernel/perfmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -2654,11 +2654,11 @@ pfm_get_task(pfm_context_t *ctx, pid_t pid, struct task_struct **task)
/* XXX: need to add more checks here */
if (pid < 2) return -EPERM;

if (pid != current->pid) {
if (pid != task_pid_vnr(current)) {

read_lock(&tasklist_lock);

p = find_task_by_pid(pid);
p = find_task_by_vpid(pid);

/* make sure task cannot go away while we operate on it */
if (p) get_task_struct(p);
Expand Down

0 comments on commit e1b0d4b

Please sign in to comment.