projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
54a50f9
)
perf report: Don't call map__kmap if map is NULL.
author
Wang Nan
<
[email protected]
>
Wed, 8 Apr 2015 10:59:32 +0000
(10:59 +0000)
committer
Arnaldo Carvalho de Melo
<
[email protected]
>
Wed, 8 Apr 2015 14:00:00 +0000
(11:00 -0300)
report__warn_kptr_restrict() calls map__kmap(kernel_map) before checking
kernel_map againest NULL.
Which is dangerous, since map__kmap() will return a invalid and not NULL
address.
It will trigger a warning message in map__kmap() after the patch "perf:
kmaps: enforce usage of kmaps to protect futher bugs." was applied.
This patch fixes it by adding the missing checking.
Signed-off-by: Wang Nan <
[email protected]
>
Cc: Adrian Hunter <
[email protected]
>
Cc: Jiri Olsa <
[email protected]
>
Cc: Zefan Li <
[email protected]
>
Cc:
[email protected]
Link:
http://lkml.kernel.org/r/
[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <
[email protected]
>
tools/perf/builtin-report.c
patch
|
blob
|
history
diff --git
a/tools/perf/builtin-report.c
b/tools/perf/builtin-report.c
index b5b2ad4ca9c4024a59daec36ae22f5804339b0f0..476cdf7afcca3fc7b1135d9973d15886cd7b8988 100644
(file)
--- a/
tools/perf/builtin-report.c
+++ b/
tools/perf/builtin-report.c
@@
-347,7
+347,7
@@
static int perf_evlist__tty_browse_hists(struct perf_evlist *evlist,
static void report__warn_kptr_restrict(const struct report *rep)
{
struct map *kernel_map = rep->session->machines.host.vmlinux_maps[MAP__FUNCTION];
- struct kmap *kernel_kmap =
map__kmap(kernel_map)
;
+ struct kmap *kernel_kmap =
kernel_map ? map__kmap(kernel_map) : NULL
;
if (kernel_map == NULL ||
(kernel_map->dso->hit &&