[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <947f8359-6380-4285-a593-55b3414ea86d@web.de>
Date: Mon, 8 Sep 2025 10:02:00 +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 v3] perf drm_pmu: fix fd_dir leaks in
for_each_drm_fdinfo_in_dir()
> Fix file descriptor leak when callback function returns error. The
…
Would it be nicer to move the last word into the next text line?
…> +++ 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);
…> +close_fdinfo:
> if (fdinfo_dir_fd != -1)
May a repeated check be avoided here?
> close(fdinfo_dir_fd);
How do you think about to use such a label directly before
the function call?
> closedir(fd_dir);
Regards,
Markus
Powered by blists - more mailing lists