Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 211940
b: refs/heads/master
c: c6be5a5
h: refs/heads/master
v: v3
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Oct 18, 2010
1 parent ad673e8 commit 7c578e9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e7d0bc047548d76feee6b23f7d3d9da927189a50
refs/heads/master: c6be5a5cb62592d9d661899a2aa78236eb00ffa5
23 changes: 12 additions & 11 deletions trunk/kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -5551,10 +5551,18 @@ SYSCALL_DEFINE5(perf_event_open,
group_leader = NULL;
}

if (pid != -1) {
task = find_lively_task_by_vpid(pid);
if (IS_ERR(task)) {
err = PTR_ERR(task);
goto err_group_fd;
}
}

event = perf_event_alloc(&attr, cpu, group_leader, NULL, NULL);
if (IS_ERR(event)) {
err = PTR_ERR(event);
goto err_fd;
goto err_task;
}

/*
Expand Down Expand Up @@ -5586,21 +5594,13 @@ SYSCALL_DEFINE5(perf_event_open,
}
}

if (pid != -1) {
task = find_lively_task_by_vpid(pid);
if (IS_ERR(task)) {
err = PTR_ERR(task);
goto err_group_fd;
}
}

/*
* Get the target context (task or percpu):
*/
ctx = find_get_context(pmu, task, cpu);
if (IS_ERR(ctx)) {
err = PTR_ERR(ctx);
goto err_task;
goto err_alloc;
}

/*
Expand Down Expand Up @@ -5696,12 +5696,13 @@ SYSCALL_DEFINE5(perf_event_open,

err_context:
put_ctx(ctx);
err_alloc:
free_event(event);
err_task:
if (task)
put_task_struct(task);
err_group_fd:
fput_light(group_file, fput_needed);
free_event(event);
err_fd:
put_unused_fd(event_fd);
return err;
Expand Down

0 comments on commit 7c578e9

Please sign in to comment.