summaryrefslogtreecommitdiffstats
path: root/kernel/perf_event.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-12-31 20:56:24 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2009-12-31 20:56:24 +0100
commit952363c90c93e967c8e1819131b68cbb6f9c962f (patch)
treed68303e8615d56cff385ee1331ab536994e8096f /kernel/perf_event.c
parentMerge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kern... (diff)
parentperf: Fix NULL deref in inheritance code (diff)
downloadlinux-952363c90c93e967c8e1819131b68cbb6f9c962f.tar.xz
linux-952363c90c93e967c8e1819131b68cbb6f9c962f.zip
Merge branch 'perf-fixes-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'perf-fixes-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: perf: Fix NULL deref in inheritance code perf: Pass appropriate frame pointer to dump_trace()
Diffstat (limited to 'kernel/perf_event.c')
-rw-r--r--kernel/perf_event.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/kernel/perf_event.c b/kernel/perf_event.c
index 1f38270f08c7..603c0d8b5df1 100644
--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@ -5148,7 +5148,7 @@ int perf_event_init_task(struct task_struct *child)
GFP_KERNEL);
if (!child_ctx) {
ret = -ENOMEM;
- goto exit;
+ break;
}
__perf_event_init_context(child_ctx, child);
@@ -5164,7 +5164,7 @@ int perf_event_init_task(struct task_struct *child)
}
}
- if (inherited_all) {
+ if (child_ctx && inherited_all) {
/*
* Mark the child context as a clone of the parent
* context, or of whatever the parent is a clone of.
@@ -5184,7 +5184,6 @@ int perf_event_init_task(struct task_struct *child)
get_ctx(child_ctx->parent_ctx);
}
-exit:
mutex_unlock(&parent_ctx->mutex);
perf_unpin_context(parent_ctx);