]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
perf python: Decrement the refcount of just created event on failure
authorArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 12 Mar 2025 20:31:39 +0000 (17:31 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Apr 2025 12:37:34 +0000 (14:37 +0200)
commit6bc0c3e7582c67891788fc16c6c21563e977f685
treef1e6f72f1f95100695933267e512690bbad66b87
parentb8e2e2cfa319b8f6f1540a82f74be91f69a28a1d
perf python: Decrement the refcount of just created event on failure

[ Upstream commit 3de5a2bf5b4847f7a59a184568f969f8fe05d57f ]

To avoid a leak if we have the python object but then something happens
and we need to return the operation, decrement the offset of the newly
created object.

Fixes: 377f698db12150a1 ("perf python: Add struct evsel into struct pyrf_event")
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Reviewed-by: Ian Rogers <irogers@google.com>
Link: https://lore.kernel.org/r/20250312203141.285263-5-acme@kernel.org
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/perf/util/python.c