summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2017-06-27 09:17:02 +0200
committerIngo Molnar <mingo@kernel.org>2017-06-27 09:17:02 +0200
commite3c2c4fb524b548e58108a8820c0ac7787667584 (patch)
treeee172d607ccd73ca627b6df319d6aced16c428a1
parentLinux 4.12-rc7 (diff)
parentperf machine: Fix segfault for kernel.kptr_restrict=2 (diff)
downloadlinux-e3c2c4fb524b548e58108a8820c0ac7787667584.tar.xz
linux-e3c2c4fb524b548e58108a8820c0ac7787667584.zip
Merge tag 'perf-urgent-for-mingo-4.12-20170626' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
Pull perf/urgent fix from Arnaldo Carvalho de Melo: - Fix segfault for kernel.kptr_restrict=2 (Jiri Olsa) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--tools/perf/util/machine.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index d7f31cb0a4cb..5de2b86b9880 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -1209,10 +1209,12 @@ int machine__create_kernel_maps(struct machine *machine)
*/
map_groups__fixup_end(&machine->kmaps);
- if (machine__get_running_kernel_start(machine, &name, &addr)) {
- } else if (maps__set_kallsyms_ref_reloc_sym(machine->vmlinux_maps, name, addr)) {
- machine__destroy_kernel_maps(machine);
- return -1;
+ if (!machine__get_running_kernel_start(machine, &name, &addr)) {
+ if (name &&
+ maps__set_kallsyms_ref_reloc_sym(machine->vmlinux_maps, name, addr)) {
+ machine__destroy_kernel_maps(machine);
+ return -1;
+ }
}
return 0;