diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-31 14:56:24 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-31 14:56:24 -0500 |
commit | 952363c90c93e967c8e1819131b68cbb6f9c962f (patch) | |
tree | d68303e8615d56cff385ee1331ab536994e8096f | |
parent | 2d959e95658a0224b0dd0d787926d5ffc95f9574 (diff) | |
parent | 05cbaa2853cdfc255fdd04e65a82bfe9208c4e52 (diff) |
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()
-rw-r--r-- | arch/x86/kernel/cpu/perf_event.c | 2 | ||||
-rw-r--r-- | kernel/perf_event.c | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c index c223b7e895d9..d616c06e99b4 100644 --- a/arch/x86/kernel/cpu/perf_event.c +++ b/arch/x86/kernel/cpu/perf_event.c | |||
@@ -2347,7 +2347,7 @@ perf_callchain_kernel(struct pt_regs *regs, struct perf_callchain_entry *entry) | |||
2347 | callchain_store(entry, PERF_CONTEXT_KERNEL); | 2347 | callchain_store(entry, PERF_CONTEXT_KERNEL); |
2348 | callchain_store(entry, regs->ip); | 2348 | callchain_store(entry, regs->ip); |
2349 | 2349 | ||
2350 | dump_trace(NULL, regs, NULL, 0, &backtrace_ops, entry); | 2350 | dump_trace(NULL, regs, NULL, regs->bp, &backtrace_ops, entry); |
2351 | } | 2351 | } |
2352 | 2352 | ||
2353 | /* | 2353 | /* |
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) | |||
5148 | GFP_KERNEL); | 5148 | GFP_KERNEL); |
5149 | if (!child_ctx) { | 5149 | if (!child_ctx) { |
5150 | ret = -ENOMEM; | 5150 | ret = -ENOMEM; |
5151 | goto exit; | 5151 | break; |
5152 | } | 5152 | } |
5153 | 5153 | ||
5154 | __perf_event_init_context(child_ctx, child); | 5154 | __perf_event_init_context(child_ctx, child); |
@@ -5164,7 +5164,7 @@ int perf_event_init_task(struct task_struct *child) | |||
5164 | } | 5164 | } |
5165 | } | 5165 | } |
5166 | 5166 | ||
5167 | if (inherited_all) { | 5167 | if (child_ctx && inherited_all) { |
5168 | /* | 5168 | /* |
5169 | * Mark the child context as a clone of the parent | 5169 | * Mark the child context as a clone of the parent |
5170 | * context, or of whatever the parent is a clone of. | 5170 | * context, or of whatever the parent is a clone of. |
@@ -5184,7 +5184,6 @@ int perf_event_init_task(struct task_struct *child) | |||
5184 | get_ctx(child_ctx->parent_ctx); | 5184 | get_ctx(child_ctx->parent_ctx); |
5185 | } | 5185 | } |
5186 | 5186 | ||
5187 | exit: | ||
5188 | mutex_unlock(&parent_ctx->mutex); | 5187 | mutex_unlock(&parent_ctx->mutex); |
5189 | 5188 | ||
5190 | perf_unpin_context(parent_ctx); | 5189 | perf_unpin_context(parent_ctx); |