Skip to content

Commit a7a7263

Browse files
liwg06acmel
authored andcommitted
perf parse-events: Fix NULL check against wrong variable
We did a null check after "tmp->symbol = strdup(...)", but we checked "list->symbol" other than "tmp->symbol". Reviewed-by: John Garry <[email protected]> Signed-off-by: Weiguo Li <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent ec9d50a commit a7a7263

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/perf/util/parse-events.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2193,7 +2193,7 @@ int perf_pmu__test_parse_init(void)
21932193
for (i = 0; i < ARRAY_SIZE(symbols); i++, tmp++) {
21942194
tmp->type = symbols[i].type;
21952195
tmp->symbol = strdup(symbols[i].symbol);
2196-
if (!list->symbol)
2196+
if (!tmp->symbol)
21972197
goto err_free;
21982198
}
21992199

0 commit comments

Comments
 (0)