public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Kerr <jk@codeconstruct.com.au>
To: Johan Hovold <johan@kernel.org>,
	Matt Johnston <matt@codeconstruct.com.au>,
	 Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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,
	stable@vger.kernel.org
Subject: Re: [PATCH] net: mctp: fix device leak on probe failure
Date: Fri, 06 Mar 2026 09:23:33 +0800	[thread overview]
Message-ID: <942e3fdf0522be797a337669b9a736b56c33e5d2.camel@codeconstruct.com.au> (raw)
In-Reply-To: <17790d338e59896ff843bbd3a3bf434f20b189c3.camel@codeconstruct.com.au>

+CC Greg

Context is Johan's patch at
https://lore.kernel.org/netdev/20260305104549.16110-1-johan@kernel.org/

Cheers,


Jeremy

> Hi John,
> 
> > Driver core holds a reference to the USB interface and its parent USB
> > device while the interface is bound to a driver and there is no need to
> > take additional references unless the structures are needed after
> > disconnect.
> > 
> > This driver takes a reference to the USB device during probe but does
> > not to release it on probe failures.
> > 
> > Drop the redundant device reference to fix the leak, reduce cargo
> > culting, make it easier to spot drivers where an extra reference is
> > needed, and reduce the risk of further memory leaks.
> 
> Sounds good, but I would suggest syncing with Greg K-H too; he's in the
> process of doing a v2 for the same thing:
> 
>   https://lore.kernel.org/netdev/2026022539-punch-supper-884c@gregkh/
> 
> Given the discussion there, this looks in-line with the longer-term move
> from usb_get_dev(), so:
> 
> Acked-by: Jeremy Kerr <jk@codeconstruct.com.au>
> 
> Thanks,
> 
> 
> Jeremy


  reply	other threads:[~2026-03-06  1:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-05 10:45 [PATCH] net: mctp: fix device leak on probe failure Johan Hovold
2026-03-05 23:58 ` Jeremy Kerr
2026-03-06  1:23   ` Jeremy Kerr [this message]
2026-03-07  0:10 ` patchwork-bot+netdevbpf

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=942e3fdf0522be797a337669b9a736b56c33e5d2.camel@codeconstruct.com.au \
    --to=jk@codeconstruct.com.au \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=johan@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matt@codeconstruct.com.au \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=stable@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