summaryrefslogtreecommitdiffstats
path: root/kernel/events
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2012-06-18 11:47:58 +0200
committerIngo Molnar <mingo@kernel.org>2012-06-18 11:47:58 +0200
commitd1ece0998eeb7b6543044f32b7d9bcbaf6dc294a (patch)
treebcbb3dddee8b5db83f07585370b1bd57f92296ac /kernel/events
parent76958a61e42fb6277a8431eb17e4bdb24176f1b7 (diff)
parent9c5da09d266ca9b32eb16cf940f8161d949c2fe5 (diff)
downloadlinux-d1ece0998eeb7b6543044f32b7d9bcbaf6dc294a.tar.bz2
Merge branch 'perf/urgent' into perf/core
Merge in all fixes before applying more changes. Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/events')
-rw-r--r--kernel/events/core.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/kernel/events/core.c b/kernel/events/core.c
index f85c0154b333..d7d71d6ec972 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -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)
@@ -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