From: Andi Kleen Date: Fri, 11 Oct 2019 18:21:40 +0000 (-0700) Subject: perf evlist: Fix fix for freed id arrays X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=5a40e1994815ab09c59614c6a13d94eef55d1a7f;p=uclinux-h8%2Flinux.git perf evlist: Fix fix for freed id arrays In the earlier fix for the memory overrun of id arrays I managed to typo the wrong event in the fix. Of course we need to close the current event in the loop, not the original failing event. The same test case as in the original patch still passes. Fixes: 7834fa948beb ("perf evlist: Fix access of freed id arrays") Signed-off-by: Andi Kleen Cc: Jiri Olsa Link: http://lore.kernel.org/lkml/20191011182140.8353-2-andi@firstfloor.org Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index 21b77efa802c..8793b4e322b0 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c @@ -1599,7 +1599,7 @@ struct evsel *perf_evlist__reset_weak_group(struct evlist *evsel_list, is_open = false; if (c2->leader == leader) { if (is_open) - perf_evsel__close(&evsel->core); + perf_evsel__close(&c2->core); c2->leader = c2; c2->core.nr_members = 0; }