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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <e2cc8ea1-28b1-4dab-aa42-b6aca486dbd7@intel.com>
Date: Mon, 4 Aug 2025 15:08:33 +0300
From: Adrian Hunter <adrian.hunter@...el.com>
To: Gautam Menghani <gautam@...ux.ibm.com>, <peterz@...radead.org>,
	<mingo@...hat.com>, <acme@...nel.org>, <namhyung@...nel.org>,
	<mark.rutland@....com>, <alexander.shishkin@...ux.intel.com>,
	<jolsa@...nel.org>, <irogers@...gle.com>, <kan.liang@...ux.intel.com>
CC: <linux-perf-users@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] perf auxtrace: Avoid redundant NULL check in
 auxtrace_mmap_params__set_idx()

On 04/08/2025 14:06, Gautam Menghani wrote:
> Since commit eead8a011477 ("libperf threadmap: Don't segv for index 0 for the
> NULL 'struct perf_thread_map' pointer"), perf_thread_map__pid() can
> check for a NULL map and return -1 if idx is 0. Cleanup
> auxtrace_mmap_params__set_idx() and remove the redundant NULL check.
> 
> No functional change intended.
> 
> Signed-off-by: Gautam Menghani <gautam@...ux.ibm.com>

Reviewed-by: Adrian Hunter <adrian.hunter@...el.com>

> ---
>  tools/perf/util/auxtrace.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c
> index ebd32f1b8f12..5e437133c753 100644
> --- a/tools/perf/util/auxtrace.c
> +++ b/tools/perf/util/auxtrace.c
> @@ -185,10 +185,7 @@ void auxtrace_mmap_params__set_idx(struct auxtrace_mmap_params *mp,
>  
>  	if (per_cpu) {
>  		mp->cpu = perf_cpu_map__cpu(evlist->core.all_cpus, idx);
> -		if (evlist->core.threads)
> -			mp->tid = perf_thread_map__pid(evlist->core.threads, 0);
> -		else
> -			mp->tid = -1;
> +		mp->tid = perf_thread_map__pid(evlist->core.threads, 0);
>  	} else {
>  		mp->cpu.cpu = -1;
>  		mp->tid = perf_thread_map__pid(evlist->core.threads, idx);


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ