Commit 952363c9 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'perf-fixes-for-linus-2' of...

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()
parents 2d959e95 05cbaa28
...@@ -2347,7 +2347,7 @@ perf_callchain_kernel(struct pt_regs *regs, struct perf_callchain_entry *entry) ...@@ -2347,7 +2347,7 @@ perf_callchain_kernel(struct pt_regs *regs, struct perf_callchain_entry *entry)
callchain_store(entry, PERF_CONTEXT_KERNEL); callchain_store(entry, PERF_CONTEXT_KERNEL);
callchain_store(entry, regs->ip); callchain_store(entry, regs->ip);
dump_trace(NULL, regs, NULL, 0, &backtrace_ops, entry); dump_trace(NULL, regs, NULL, regs->bp, &backtrace_ops, entry);
} }
/* /*
......
...@@ -5148,7 +5148,7 @@ int perf_event_init_task(struct task_struct *child) ...@@ -5148,7 +5148,7 @@ int perf_event_init_task(struct task_struct *child)
GFP_KERNEL); GFP_KERNEL);
if (!child_ctx) { if (!child_ctx) {
ret = -ENOMEM; ret = -ENOMEM;
goto exit; break;
} }
__perf_event_init_context(child_ctx, child); __perf_event_init_context(child_ctx, child);
...@@ -5164,7 +5164,7 @@ int perf_event_init_task(struct task_struct *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 * Mark the child context as a clone of the parent
* context, or of whatever the parent is a clone of. * context, or of whatever the parent is a clone of.
...@@ -5184,7 +5184,6 @@ int perf_event_init_task(struct task_struct *child) ...@@ -5184,7 +5184,6 @@ int perf_event_init_task(struct task_struct *child)
get_ctx(child_ctx->parent_ctx); get_ctx(child_ctx->parent_ctx);
} }
exit:
mutex_unlock(&parent_ctx->mutex); mutex_unlock(&parent_ctx->mutex);
perf_unpin_context(parent_ctx); perf_unpin_context(parent_ctx);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment