From: sashiko-bot@kernel.org
To: "Gu Bin" <gubin@cmss.chinamobile.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH] perf parse-events: free partially copied terms if term cloning fails
Date: Tue, 17 Nov 2026 10:06:27 +0000 [thread overview]
Message-ID: <sashiko-outbox-218569@kernel.org> (raw)
In-Reply-To: <20261117095603.2397-2-gubin@cmss.chinamobile.com>
> parse_events_terms__copy() clones the terms of src into dest one by
> one and stops as soon as parse_events_term__clone() fails, leaving the
> terms cloned so far queued on dest->terms. Both callers,
> parse_events_add_pmu() and parse_events_multi_pmu_add(), return on
> that error without freeing the local parsed_terms, so the partially
> copied terms and their strings are leaked.
>
> Free the local terms with parse_events_terms__exit() before
> returning, as both functions already do on their later error paths.
>
> Fixes: 0d3f0e6f94ef ("perf parse-events: Introduce 'struct parse_events_terms'")
> Signed-off-by: Gu Bin <gubin@cmss.chinamobile.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261117095603.2397-2-gubin@cmss.chinamobile.com?part=1
next prev parent reply other threads:[~2026-11-17 10:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-17 9:56 [PATCH] perf trace: free filter_pids entries in trace__exit() Gu Bin
2026-11-17 9:56 ` [PATCH] perf parse-events: free partially copied terms if term cloning fails Gu Bin
2026-11-17 10:06 ` sashiko-bot [this message]
2026-11-17 10:03 ` [PATCH] perf trace: free filter_pids entries in trace__exit() sashiko-bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=sashiko-outbox-218569@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=gubin@cmss.chinamobile.com \
--cc=linux-perf-users@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox