Netdev List
 help / color / mirror / Atom feed
From: FUJITA Tomonori <tomo@flapping.org>
To: netdev-bot+sashiko@kernel.org
Cc: johan@kernel.org, fujita.tomonori@gmail.com,
	andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org,
	kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org,
	stable@vger.kernel.org, hfdevel@gmx.net
Subject: Re: [PATCH net] net: tn40xx: fix swnode use-after-free on probe failure
Date: Sun, 15 Nov 2026 20:47:41 +0900 (JST)	[thread overview]
Message-ID: <20261115.204741.1750241782166111925.tomo@flapping.org> (raw)
In-Reply-To: <179452098811.2199510.15081106290449010908@kernel.org>

On Thu, 12 Nov 2026 22:03:08 +0000
netdev-bot+sashiko@kernel.org wrote:

>> --- a/drivers/net/ethernet/tehuti/tn40_mdio.c
>> +++ b/drivers/net/ethernet/tehuti/tn40_mdio.c
>> @@ -157,7 +157,6 @@ void tn40_swnodes_cleanup(struct tn40_priv *priv)
>>  {
>>  	/* cleanup of swnodes is only needed for AQR105-based cards */
>>  	if (priv->pdev->device == PCI_DEVICE_ID_TEHUTI_TN9510) {
>> -		fwnode_handle_put(dev_fwnode(&priv->mdio->dev));
> 
> [Severity: High]
> Is this put really stray? It seems to balance the reference that the MDIO
> core takes on the bus fwnode when the bus is registered:

I think Sashiko's analysis is correct:

- The fwnode_handle_put() in tn40_swnodes_cleanup() drops the
  reference taken by fwnode_handle_get() in __mdiobus_register().

- tn40_swnodes_cleanup() calls device_remove_software_node(), which
  sets bus->dev.fwnode to NULL. So the fwnode_handle_put() in
  mdiobus_release() does nothing for this bus.

  reply	other threads:[~2026-11-15 11:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-10 10:00 [PATCH net] net: tn40xx: fix swnode use-after-free on probe failure Johan Hovold
2026-11-10 10:06 ` netdev-bot+sinfo
2026-11-10 10:12   ` Johan Hovold
2026-11-12 22:03 ` netdev-bot+sashiko
2026-11-15 11:47   ` FUJITA Tomonori [this message]
2026-11-16  8:54   ` Johan Hovold

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=20261115.204741.1750241782166111925.tomo@flapping.org \
    --to=tomo@flapping.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=fujita.tomonori@gmail.com \
    --cc=hfdevel@gmx.net \
    --cc=johan@kernel.org \
    --cc=kuba@kernel.org \
    --cc=netdev-bot+sashiko@kernel.org \
    --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