All of lore.kernel.org
 help / color / mirror / Atom feed
From: Breno Leitao <leitao@debian.org>
To: sashiko-reviews@lists.linux.dev
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v2] perf bench: add --write-size option to sched pipe
Date: Thu, 21 May 2026 10:12:33 -0700	[thread overview]
Message-ID: <ag88W3-LcSt131jZ@gmail.com> (raw)
In-Reply-To: <20260521163951.2E2FB1F000E9@smtp.kernel.org>

On Thu, May 21, 2026 at 04:39:50PM +0000, sashiko-bot@kernel.org wrote:
> [Severity: Medium]
> Are the file descriptors allocated for pipe_1 and pipe_2 leaked on this error
> path?
> 
> The pipe2() calls just above this block allocate four file descriptors. If the
> fcntl() operations fail and this path returns -1, those descriptors appear to
> be left open.

Technically true, but not a problem in practice: bench_sched_pipe()
returning -1 bubbles up to perf bench and the process exits, so the
kernel reclaims the fds, and there is no real leak. 

There's no actual leak in the running program; it's purely a static-analysis nit.

The rest of the function follows the same pattern — pipes are never explicitly
closed on the success path either, they're released at exit.

Not planning to fix in v3 unless a maintainer prefers otherwise.

  reply	other threads:[~2026-05-21 17:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-21 16:15 [PATCH v2] perf bench: add --write-size option to sched pipe Breno Leitao
2026-05-21 16:39 ` sashiko-bot
2026-05-21 17:12   ` Breno Leitao [this message]
2026-05-26  2:17 ` Namhyung Kim
2026-05-26 17:55   ` Breno Leitao
2026-05-27  5:22     ` Namhyung Kim
2026-05-27  9:03       ` Breno Leitao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ag88W3-LcSt131jZ@gmail.com \
    --to=leitao@debian.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.