mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
perf stat: Fix NULL pointer dereference
[ Upstream commit c0c652fc705de75f4ba52e93053acc1ed3933e74 ]
If config->aggr_map is NULL and config->aggr_get_id is not NULL,
the function print_aggr() will still calling arrg_update_shadow(),
which can result in accessing the invalid pointer.
Fixes: 088519f318 ("perf stat: Move the display functions to stat-display.c")
Signed-off-by: Hongbo Yao <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Wei Li <[email protected]>
Link: https://lore.kernel.org/lkml/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
This commit is contained in:
parent
676634f1a8
commit
aa7baef530
1 changed files with 2 additions and 2 deletions
|
|
@ -661,7 +661,7 @@ static void print_aggr(struct perf_stat_config *config,
|
|||
int s;
|
||||
bool first;
|
||||
|
||||
if (!(config->aggr_map || config->aggr_get_id))
|
||||
if (!config->aggr_map || !config->aggr_get_id)
|
||||
return;
|
||||
|
||||
aggr_update_shadow(config, evlist);
|
||||
|
|
@ -1140,7 +1140,7 @@ static void print_percore(struct perf_stat_config *config,
|
|||
int s;
|
||||
bool first = true;
|
||||
|
||||
if (!(config->aggr_map || config->aggr_get_id))
|
||||
if (!config->aggr_map || !config->aggr_get_id)
|
||||
return;
|
||||
|
||||
for (s = 0; s < config->aggr_map->nr; s++) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue