From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
Masami Hiramatsu <mhiramat@kernel.org>,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
Arnaldo Carvalho de Melo <acme@redhat.com>,
linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v2] perf probe: Fix an error handling path in 'parse_perf_probe_command()'
Date: Wed, 10 Aug 2022 10:10:26 -0300 [thread overview]
Message-ID: <YvOuQnSdT31wSPZ8@kernel.org> (raw)
In-Reply-To: <b71bcb01fa0c7b9778647235c3ab490f699ba278.1659797452.git.christophe.jaillet@wanadoo.fr>
Em Sat, Aug 06, 2022 at 04:51:26PM +0200, Christophe JAILLET escreveu:
> If a memory allocation fail, we should branch to the error handling path in
> order to free some resources allocated a few lines above.
>
> Fixes: 15354d546986 ("perf probe: Generate event name with line number")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Thanks, applied.
- Arnaldo
> ---
> Change in v2:
> - Synch with latest -next
> - Add A-by tag (see link below, it was old!)
>
> v1:
> https://lore.kernel.org/all/20200315201259.29190-1-christophe.jaillet@wanadoo.fr/
> ---
> tools/perf/util/probe-event.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
> index 67c12d5303e7..785246ff4179 100644
> --- a/tools/perf/util/probe-event.c
> +++ b/tools/perf/util/probe-event.c
> @@ -1775,8 +1775,10 @@ int parse_perf_probe_command(const char *cmd, struct perf_probe_event *pev)
> if (!pev->event && pev->point.function && pev->point.line
> && !pev->point.lazy_line && !pev->point.offset) {
> if (asprintf(&pev->event, "%s_L%d", pev->point.function,
> - pev->point.line) < 0)
> - return -ENOMEM;
> + pev->point.line) < 0) {
> + ret = -ENOMEM;
> + goto out;
> + }
> }
>
> /* Copy arguments and ensure return probe has no C argument */
> --
> 2.34.1
--
- Arnaldo
prev parent reply other threads:[~2022-08-10 13:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-06 14:51 [PATCH v2] perf probe: Fix an error handling path in 'parse_perf_probe_command()' Christophe JAILLET
2022-08-10 13:10 ` Arnaldo Carvalho de Melo [this message]
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=YvOuQnSdT31wSPZ8@kernel.org \
--to=acme@kernel.org \
--cc=acme@redhat.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=jolsa@kernel.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mhiramat@kernel.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.