All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Miaoqian Lin <linmq006@gmail.com>
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@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
	Song Liu <song@kernel.org>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf tools: Fix NULL vs IS_ERR_OR_NULL() checking
Date: Sat, 11 Dec 2021 08:25:57 -0300	[thread overview]
Message-ID: <YbSKxcj7Ld+0JQ/F@kernel.org> (raw)
In-Reply-To: <20211211053856.19827-1-linmq006@gmail.com>

Em Sat, Dec 11, 2021 at 05:38:53AM +0000, Miaoqian Lin escreveu:
> The function trace_event__tp_format_id may return ERR_PTR(-ENOMEM).
> Use IS_ERR_OR_NULL to check tp_format.

Thanks, applied.

- Arnaldo

 
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
> ---
>  tools/perf/util/python.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c
> index 563a9ba8954f..7f782a31bda3 100644
> --- a/tools/perf/util/python.c
> +++ b/tools/perf/util/python.c
> @@ -461,7 +461,7 @@ get_tracepoint_field(struct pyrf_event *pevent, PyObject *attr_name)
>  		struct tep_event *tp_format;
>  
>  		tp_format = trace_event__tp_format_id(evsel->core.attr.config);
> -		if (!tp_format)
> +		if (IS_ERR_OR_NULL(tp_format))
>  			return NULL;
>  
>  		evsel->tp_format = tp_format;
> -- 
> 2.17.1

-- 

- Arnaldo

      reply	other threads:[~2021-12-11 11:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-11  5:38 [PATCH] perf tools: Fix NULL vs IS_ERR_OR_NULL() checking Miaoqian Lin
2021-12-11 11:25 ` 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=YbSKxcj7Ld+0JQ/F@kernel.org \
    --to=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=jolsa@redhat.com \
    --cc=linmq006@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=song@kernel.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.