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: <bcabd7c0-9ca9-4ef6-8114-fc80a890a17a@web.de>
Date: Mon, 25 Aug 2025 14:06:57 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: GuoHan Zhao <zhaoguohan@...inos.cn>, linux-perf-users@...r.kernel.org
Cc: LKML <linux-kernel@...r.kernel.org>,
 Adrian Hunter <adrian.hunter@...el.com>,
 Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
 Arnaldo Carvalho de Melo <acme@...nel.org>, Ian Rogers <irogers@...gle.com>,
 Ingo Molnar <mingo@...hat.com>, Jiri Olsa <jolsa@...nel.org>,
 Kan Liang <kan.liang@...ux.intel.com>, Mark Rutland <mark.rutland@....com>,
 Namhyung Kim <namhyung@...nel.org>, Peter Zijlstra <peterz@...radead.org>
Subject: Re: [PATCH v2] perf drm_pmu: fix fd_dir leaks in
 for_each_drm_fdinfo_in_dir()

…
> +++ b/tools/perf/util/drm_pmu.c
> @@ -458,8 +458,10 @@ static int for_each_drm_fdinfo_in_dir(int (*cb)(void *args, int fdinfo_dir_fd, c
>  		}
>  		ret = cb(args, fdinfo_dir_fd, fd_entry->d_name);
>  		if (ret)
> -			return ret;
> +			goto cleanup;
>  	}
> +
> +cleanup:
>  	if (fdinfo_dir_fd != -1)

Would it be nicer to use a label like “close_fdinfo” instead
at this source code place (so that a repeated check could be avoided)?


>  		close(fdinfo_dir_fd);
>  	closedir(fd_dir);


Regards,
Markus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ