All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: John Garry <john.garry@huawei.com>
Cc: Weiguo Li <liwg06@foxmail.com>,
	peterz@infradead.org, mingo@redhat.com, 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: Sat, 12 Mar 2022 10:48:26 -0300	[thread overview]
Message-ID: <YiykquZ6QK/294sl@kernel.org> (raw)
In-Reply-To: <a007c783-49a2-4ab3-a592-9f37ea41eaae@huawei.com>

Em Fri, Mar 11, 2022 at 02:00:13PM +0000, John Garry escreveu:
> 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>

Thanks, applied.

- Arnaldo

 
> > ---
> >   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;
> >   	}

-- 

- Arnaldo

      reply	other threads:[~2022-03-12 13:48 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
2022-03-12 13:48   ` 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=YiykquZ6QK/294sl@kernel.org \
    --to=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=john.garry@huawei.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 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.