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: <ZsX7tft1EDDAAylh@x1>
Date: Wed, 21 Aug 2024 11:37:41 -0300
From: Arnaldo Carvalho de Melo <acme@...nel.org>
To: Yang Ruibin <11162571@...o.com>
Cc: Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>,
	Namhyung Kim <namhyung@...nel.org>,
	Mark Rutland <mark.rutland@....com>,
	Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
	Jiri Olsa <jolsa@...nel.org>, Ian Rogers <irogers@...gle.com>,
	Adrian Hunter <adrian.hunter@...el.com>,
	"Liang, Kan" <kan.liang@...ux.intel.com>,
	Stephen Rothwell <sfr@...b.auug.org.au>,
	linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org,
	bpf@...r.kernel.org, opensource.kernel@...o.com
Subject: Re: [PATCH v1] tools:util:Remove the check that map is empty.

On Wed, Aug 21, 2024 at 06:14:56AM -0400, Yang Ruibin wrote:
> The check that map is empty is already done in the bpf_map__fd (map)
> function and returns an err_no, which does not run further checks.
>  In addition, even if the check for map is run, the return is a pointer,
>  which is not consistent with the err_number returned by bpf_map__fd (map).

Thanks, applied, looks like an artifact from the patch that removed the
bpf_map__def() API.

- Arnaldo
 
> Signed-off-by: Yang Ruibin <11162571@...o.com>
> ---
>  tools/perf/util/bpf_map.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/tools/perf/util/bpf_map.c b/tools/perf/util/bpf_map.c
> index 81a4d5a7ccf7..578f27d2d6b4 100644
> --- a/tools/perf/util/bpf_map.c
> +++ b/tools/perf/util/bpf_map.c
> @@ -35,9 +35,6 @@ int bpf_map__fprintf(struct bpf_map *map, FILE *fp)
>  	if (fd < 0)
>  		return fd;
>  
> -	if(!map)
> -		return PTR_ERR(map);
> -
>  	err = -ENOMEM;
>  	key = malloc(bpf_map__key_size(map));
>  	if (key == NULL)
> -- 
> 2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ