From: John Garry <john.garry@huawei.com>
To: Weiguo Li <liwg06@foxmail.com>, <peterz@infradead.org>,
<mingo@redhat.com>, <acme@kernel.org>
Cc: <mark.rutland@arm.com>, <alexander.shishkin@linux.intel.com>,
<jolsa@kernel.org>, <namhyung@kernel.org>,
<linux-perf-users@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] perf parse-events: Fix null check
Date: Fri, 11 Mar 2022 14:00:13 +0000 [thread overview]
Message-ID: <a007c783-49a2-4ab3-a592-9f37ea41eaae@huawei.com> (raw)
In-Reply-To: <tencent_DF39269807EC9425E24787E6DB632441A405@qq.com>
On 11/03/2022 13:06, Weiguo Li wrote:
> We did a null check after "tmp->symbol = strdup(...)", but we checked
> "list->symbol" other than "tmp->symbol".
>
> Signed-off-by: Weiguo Li <liwg06@foxmail.com>
Reviewed-by: John Garry <john.garry@huawei.com>
> ---
> tools/perf/util/parse-events.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
> index 9739b05b999e..dfb50a5f83d0 100644
> --- a/tools/perf/util/parse-events.c
> +++ b/tools/perf/util/parse-events.c
> @@ -2193,7 +2193,7 @@ int perf_pmu__test_parse_init(void)
> for (i = 0; i < ARRAY_SIZE(symbols); i++, tmp++) {
> tmp->type = symbols[i].type;
> tmp->symbol = strdup(symbols[i].symbol);
> - if (!list->symbol)
> + if (!tmp->symbol)
> goto err_free;
> }
>
next prev parent reply other threads:[~2022-03-11 14:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-11 13:06 [PATCH] perf parse-events: Fix null check Weiguo Li
2022-03-11 14:00 ` John Garry [this message]
2022-03-12 13:48 ` Arnaldo Carvalho de Melo
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=a007c783-49a2-4ab3-a592-9f37ea41eaae@huawei.com \
--to=john.garry@huawei.com \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=liwg06@foxmail.com \
--cc=mark.rutland@arm.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox