All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Namhyung Kim <namhyung@kernel.org>
Cc: sashiko-reviews@lists.linux.dev, linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v1 1/3] perf sched: Add missing perf_session__delete()
Date: Thu, 10 Sep 2026 11:11:32 -0300	[thread overview]
Message-ID: <aqK6lHUNwgZzn1Cn@x2> (raw)
In-Reply-To: <alVt_4Oaj8SvqAlv@google.com>

On Mon, Jul 13, 2026 at 04:00:15PM -0700, Namhyung Kim wrote:
> On Mon, Jul 13, 2026 at 08:59:07PM +0000, sashiko-bot@kernel.org wrote:
> > Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> > > +++ b/tools/perf/builtin-sched.c
> > > @@ -4027,6 +4027,7 @@ static int perf_sched__schedstat_record(struct perf_sched *sched,
> > >  	else
> > >  		fprintf(stderr, "[ perf sched stats: Failed !! ]\n");
> > >  
> > > +	perf_session__delete(session);
> > >  	evlist__put(evlist);
> > >  	close(fd);
> > 
> > [Severity: Medium]
> > Does adding perf_session__delete() result in closing the file descriptor twice?
> > 
> > Since perf_session__delete() internally closes the file descriptor associated
> > with the session data, the subsequent explicit close(fd) will attempt to
> > close it again. This could return EBADF or erroneously close an unrelated
> > file descriptor if another thread opens a file in the meantime.
> 
> Hmm.. looks right.  I think I can just remove the close().

Ok, waiting for v2 then.

- Arnaldo

  reply	other threads:[~2026-09-10 14:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-13 20:47 [PATCH v1 0/3] perf sched stats: Fix memory leaks Namhyung Kim
2026-07-13 20:47 ` [PATCH v1 1/3] perf sched: Add missing perf_session__delete() Namhyung Kim
2026-07-13 20:59   ` sashiko-bot
2026-07-13 23:00     ` Namhyung Kim
2026-09-10 14:11       ` Arnaldo Carvalho de Melo [this message]
2026-07-13 20:47 ` [PATCH v1 2/3] perf sched: Fix memory leaks in perf sched stats report Namhyung Kim
2026-07-13 20:47 ` [PATCH v1 3/3] perf sched: Free subcommand string after perf sched stats Namhyung Kim

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=aqK6lHUNwgZzn1Cn@x2 \
    --to=acme@kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=namhyung@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.