From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: "Krzysztof Wilczyński" <kw@linux.com>
Cc: Gianfranco Dutka <gianfranco.dutka@arista.com>,
Bjorn Helgaas <bhelgaas@google.com>,
linux-pci@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] PCI/sysfs: NULL res_attr slot after kfree as defence against double-remove
Date: Thu, 21 May 2026 15:04:53 +0300 (EEST) [thread overview]
Message-ID: <e47086a4-43ea-997d-e49f-356cc21d22e8@linux.intel.com> (raw)
In-Reply-To: <20260521115906.GC647881@rocinante>
[-- Attachment #1: Type: text/plain, Size: 876 bytes --]
On Thu, 21 May 2026, Krzysztof Wilczyński wrote:
> > To me it looks more like pci_remove_resource_files() is expected to be
> > entered only once.
> >
> > If this change is accepted, the 2nd entry is "silently" allowed whereas
> > better course of action would feel to catch that in
> > pci_remove_resource_files() with:
> >
> > if (WARN_ON_ONCE(something))
> > return;
> >
> > That way, developers may become aware the code has some lifetime issue.
> >
> > (I'm not strictly against your change but I think it would be much better
> > to have sane lifetimes and catch offenders.)
>
> The upcoming sysfs changes would remove pci_remove_resource_files()
> completely, so there would not be anything needed to be done here,
> hopefully.
Yeah, I should have looked at that branch first instead of checking just
code in mainline.
--
i.
next prev parent reply other threads:[~2026-05-21 12:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-20 21:13 Gianfranco Dutka
2026-05-20 22:45 ` Gianfranco Dutka
2026-05-21 11:54 ` Krzysztof Wilczyński
2026-05-21 10:22 ` Ilpo Järvinen
2026-05-21 12:01 ` Krzysztof Wilczyński
2026-05-21 12:04 ` Ilpo Järvinen [this message]
2026-05-21 11:59 ` Krzysztof Wilczyński
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=e47086a4-43ea-997d-e49f-356cc21d22e8@linux.intel.com \
--to=ilpo.jarvinen@linux.intel.com \
--cc=bhelgaas@google.com \
--cc=gianfranco.dutka@arista.com \
--cc=kw@linux.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®