From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: "Usyskin, Alexander" <alexander.usyskin@intel.com>
Cc: "Abliyev, Reuven" <reuven.abliyev@intel.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [char-misc-next v2] mei: bus: fix device leak
Date: Mon, 30 Jun 2025 13:18:14 +0200 [thread overview]
Message-ID: <2025063022-riverbed-country-5c2b@gregkh> (raw)
In-Reply-To: <CY5PR11MB63664DE1B93F480CCC199D8FED46A@CY5PR11MB6366.namprd11.prod.outlook.com>
On Mon, Jun 30, 2025 at 10:52:08AM +0000, Usyskin, Alexander wrote:
> > Subject: Re: [char-misc-next v2] mei: bus: fix device leak
> >
> > On Tue, Jun 24, 2025 at 02:05:20PM +0300, Alexander Usyskin wrote:
> > > The bus rescan function creates bus devices for all clients.
> > > The fixup routine is executed on all devices, unneeded
> > > devices are removed and fully initialized once set
> > > is_added flag to 1.
> >
> > I don't understand why the mei bus is so special that it has to have
> > this type of flag, when no other bus has that for its devices. The bus
> > code should know if the device has been properly added or not, if not,
> > then no release function can be called and the structure isn't even
> > viable to be used or touched at all.
> >
> > So why is this needed?
>
> It seems that is_added can be replaced by device_is_registered().
Again, why do you need to track that?
But yes, that should work, although using it is usually a sign that
something is a bit broken in the design.
thanks
greg k-h
next prev parent reply other threads:[~2025-06-30 11:18 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-24 11:05 [char-misc-next v2] mei: bus: fix device leak Alexander Usyskin
2025-06-24 11:35 ` Greg Kroah-Hartman
2025-06-28 12:10 ` Greg Kroah-Hartman
2025-06-30 10:52 ` Usyskin, Alexander
2025-06-30 11:18 ` Greg Kroah-Hartman [this message]
2025-06-30 11:27 ` Usyskin, Alexander
2025-06-30 12:54 ` Greg Kroah-Hartman
2025-07-07 7:08 ` Usyskin, Alexander
2025-07-07 7:46 ` Greg Kroah-Hartman
2025-07-07 8:02 ` Usyskin, Alexander
2025-06-28 12:10 ` Greg Kroah-Hartman
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=2025063022-riverbed-country-5c2b@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=alexander.usyskin@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=reuven.abliyev@intel.com \
/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