]> git.baikalelectronics.ru Git - kernel.git/commit
perf evlist: Fix cpu/thread map leak
authorNamhyung Kim <namhyung@kernel.org>
Tue, 15 Sep 2020 03:18:11 +0000 (12:18 +0900)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 15 Sep 2020 11:59:26 +0000 (08:59 -0300)
commitdd4cf52a1425b0a76fba2ed07d9ef36707fe4c81
tree94ec3bfb8facc1f786325acea321b3b3f7681f25
parent3e23c0c8dc0a72ab28426fc7439d66c3f2b9e7b8
perf evlist: Fix cpu/thread map leak

Asan reported leak of cpu and thread maps as they have one more refcount
than released.  I found that after setting evlist maps it should release
it's refcount.

It seems to be broken from the beginning so I chose the original commit
as the culprit.  But not sure how it's applied to stable trees since
there are many changes in the code after that.

Fixes: 1adad86be82a7 ("perf evlist: Store pointer to the cpu and thread maps")
Fixes: 09aa4671483e8 ("perf evlist: Default to syswide target when no thread/cpu maps set")
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lore.kernel.org/lkml/20200915031819.386559-4-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/evlist.c