mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
perf callchain: Fix segfault in thread__resolve_callchain_sample()
commit aceb98261ea7d9fe38f9c140c5531f0b13623832 upstream.
Do not dereference 'chain' when it is NULL.
$ perf record -e intel_pt//u -e branch-misses:u uname
$ perf report --itrace=l --branch-history
perf: Segmentation fault
Fixes: e9024d519d ("perf callchain: Honour the ordering of PERF_CONTEXT_{USER,KERNEL,etc}")
Signed-off-by: Adrian Hunter <[email protected]>
Tested-by: Arnaldo Carvalho de Melo <[email protected]>
Cc: Jiri Olsa <[email protected]>
Link: http://lore.kernel.org/lkml/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
5850179285
commit
632a300260
1 changed files with 1 additions and 1 deletions
|
|
@ -2403,7 +2403,7 @@ static int thread__resolve_callchain_sample(struct thread *thread,
|
|||
}
|
||||
|
||||
check_calls:
|
||||
if (callchain_param.order != ORDER_CALLEE) {
|
||||
if (chain && callchain_param.order != ORDER_CALLEE) {
|
||||
err = find_prev_cpumode(chain, thread, cursor, parent, root_al,
|
||||
&cpumode, chain->nr - first_call);
|
||||
if (err)
|
||||
|
|
|
|||
Loading…
Reference in a new issue