lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <YbSKxcj7Ld+0JQ/F@kernel.org>
Date:   Sat, 11 Dec 2021 08:25:57 -0300
From:   Arnaldo Carvalho de Melo <acme@...nel.org>
To:     Miaoqian Lin <linmq006@...il.com>
Cc:     Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Jiri Olsa <jolsa@...hat.com>,
        Namhyung Kim <namhyung@...nel.org>, Song Liu <song@...nel.org>,
        linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] perf tools: Fix NULL vs IS_ERR_OR_NULL() checking

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@...il.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ