diff options
author | Ingo Molnar <mingo@kernel.org> | 2017-06-27 09:17:02 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2017-06-27 09:17:02 +0200 |
commit | e3c2c4fb524b548e58108a8820c0ac7787667584 (patch) | |
tree | ee172d607ccd73ca627b6df319d6aced16c428a1 | |
parent | c0bc126f97fb929b3ae02c1c62322645d70eb408 (diff) | |
parent | 3f938ee2f6c4fff8d95b24636a0964b5a93cf547 (diff) |
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.c | 10 |
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; |