Netdev List
 help / color / mirror / Atom feed
From: Jeremy Kerr <jk@codeconstruct.com.au>
To: Myeonghun Pak <mhun512@gmail.com>,
	Matt Johnston <matt@codeconstruct.com.au>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S . Miller"	 <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski	 <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Ijae Kim <ae878000@gmail.com>
Subject: Re: [PATCH net] net: mctp i3c: clean up notifier and buses if driver register fails
Date: Wed, 15 Jul 2026 08:46:24 +0800	[thread overview]
Message-ID: <1708246e17ce72f3b30d77ccb54d79b8d0909a8f.camel@codeconstruct.com.au> (raw)
In-Reply-To: <20260714081025.89163-1-mhun512@gmail.com>

Hi,

> mctp_i3c_mod_init() registers the I3C bus notifier and then walks the
> existing buses with i3c_for_each_bus_locked(mctp_i3c_bus_add_new, NULL)
> before registering the I3C device driver.  If i3c_driver_register()
> fails, the function returns the error directly, leaving the notifier
> registered and every mctp_i3c_bus object created for the existing buses
> allocated.  The notifier is left pointing into the module that failed to
> load and the bus list is leaked.
> 
> Mirror the module exit path on this failure: unregister the notifier and
> tear down the buses that were added before returning the error.

Looks good, but we probably want to remove the unneeded
i3c_driver_unregister in the notify registration failure path too.

Also, you're missing Horms from the CC; more out of curiosity, but
how did you generate the CC list here?

Cheers,


Jeremy

  reply	other threads:[~2026-07-15  0:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-14  8:10 [PATCH net] net: mctp i3c: clean up notifier and buses if driver register fails Myeonghun Pak
2026-07-15  0:46 ` Jeremy Kerr [this message]
2026-07-15  7:24   ` Myeonghun Pak

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=1708246e17ce72f3b30d77ccb54d79b8d0909a8f.camel@codeconstruct.com.au \
    --to=jk@codeconstruct.com.au \
    --cc=ae878000@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matt@codeconstruct.com.au \
    --cc=mhun512@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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