diff options
author | Namhyung Kim <namhyung@kernel.org> | 2020-09-15 05:18:17 +0200 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2020-09-15 14:22:21 +0200 |
commit | 6f47ed6cd12a0ea9b55b19b5d6e4a3b490a97bdf (patch) | |
tree | 40ded442b07adb209ccbadac84005d8a91165579 /block/blk-rq-qos.h | |
parent | perf metric: Free metric when it failed to resolve (diff) | |
download | linux-6f47ed6cd12a0ea9b55b19b5d6e4a3b490a97bdf.tar.xz linux-6f47ed6cd12a0ea9b55b19b5d6e4a3b490a97bdf.zip |
perf metric: Do not free metric when failed to resolve
It's dangerous to free the original metric when it's called from
resolve_metric() as it's already in the metric_list and might have other
resources too. Instead, it'd better let them bail out and be released
properly at the later stage.
So add a check when it's called from metricgroup__add_metric() and
release it. Also make sure that mp is set properly.
Fixes: 83de0b7d535de ("perf metric: Collect referenced metrics in struct metric_ref_node")
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-10-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'block/blk-rq-qos.h')
0 files changed, 0 insertions, 0 deletions