mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
perf annotate: Check null of sym pointer before using it
Sym may be NULL, and that will cause perf to crash. Signed-off-by: Shan Wei <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
This commit is contained in:
parent
dd4f52232c
commit
c0a58fb2bd
1 changed files with 3 additions and 1 deletions
|
|
@ -814,7 +814,7 @@ int symbol__tui_annotate(struct symbol *sym, struct map *map, int evidx,
|
|||
{
|
||||
struct disasm_line *pos, *n;
|
||||
struct annotation *notes;
|
||||
const size_t size = symbol__size(sym);
|
||||
size_t size;
|
||||
struct map_symbol ms = {
|
||||
.map = map,
|
||||
.sym = sym,
|
||||
|
|
@ -834,6 +834,8 @@ int symbol__tui_annotate(struct symbol *sym, struct map *map, int evidx,
|
|||
if (sym == NULL)
|
||||
return -1;
|
||||
|
||||
size = symbol__size(sym);
|
||||
|
||||
if (map->dso->annotate_warned)
|
||||
return -1;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue