Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 311196
b: refs/heads/master
c: 9c5da09
h: refs/heads/master
v: v3
  • Loading branch information
Salman Qazi authored and Ingo Molnar committed Jun 18, 2012
1 parent 0544de4 commit 03b0d67
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 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: 8ed9eac4769407a8f0b93e381a3bc3ae81fa014b
refs/heads/master: 9c5da09d266ca9b32eb16cf940f8161d949c2fe5
10 changes: 7 additions & 3 deletions trunk/kernel/events/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,9 @@ perf_cgroup_match(struct perf_event *event)
return !event->cgrp || event->cgrp == cpuctx->cgrp;
}

static inline void perf_get_cgroup(struct perf_event *event)
static inline bool perf_tryget_cgroup(struct perf_event *event)
{
css_get(&event->cgrp->css);
return css_tryget(&event->cgrp->css);
}

static inline void perf_put_cgroup(struct perf_event *event)
Expand Down Expand Up @@ -484,7 +484,11 @@ static inline int perf_cgroup_connect(int fd, struct perf_event *event,
event->cgrp = cgrp;

/* must be done before we fput() the file */
perf_get_cgroup(event);
if (!perf_tryget_cgroup(event)) {
event->cgrp = NULL;
ret = -ENOENT;
goto out;
}

/*
* all events in a group must monitor
Expand Down

0 comments on commit 03b0d67

Please sign in to comment.