netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Heiner Kallweit <hkallweit1@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>, Andrew Lunn <andrew+netdev@lunn.ch>,
	Russell King - ARM Linux <linux@armlinux.org.uk>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Eric Dumazet <edumazet@google.com>,
	David Miller <davem@davemloft.net>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Florian Fainelli <f.fainelli@gmail.com>
Subject: Re: [PATCH v3 net] net: phy: fixed_phy: fix missing calls to gpiod_put in fixed_mdio_bus_exit
Date: Thu, 28 Aug 2025 12:31:53 +0200	[thread overview]
Message-ID: <fbdea48d-2bb4-4b84-8ac4-98480fa99143@gmail.com> (raw)
In-Reply-To: <b3fae8d9-a595-4eb8-a90e-de2f9caebca0@gmail.com>

On 8/27/2025 11:02 PM, Heiner Kallweit wrote:
> Cleanup in fixed_mdio_bus_exit() misses to call gpiod_put().
> Easiest fix is to call fixed_phy_del() for each possible phy address.
> This may consume a few cpu cycles more, but is much easier to read.
> 
> Fixes: a5597008dbc2 ("phy: fixed_phy: Add gpio to determine link up/down.")
> Cc: stable@vger.kernel.org
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> ---
> v2:
> - rebase for net
> v3:
> - add missing blamed author
> ---
>  drivers/net/phy/fixed_phy.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/phy/fixed_phy.c b/drivers/net/phy/fixed_phy.c
> index 033656d57..a1db96944 100644
> --- a/drivers/net/phy/fixed_phy.c
> +++ b/drivers/net/phy/fixed_phy.c
> @@ -352,17 +352,13 @@ module_init(fixed_mdio_bus_init);
>  static void __exit fixed_mdio_bus_exit(void)
>  {
>  	struct fixed_mdio_bus *fmb = &platform_fmb;
> -	struct fixed_phy *fp, *tmp;
>  
>  	mdiobus_unregister(fmb->mii_bus);
>  	mdiobus_free(fmb->mii_bus);
>  	faux_device_destroy(fdev);
>  
> -	list_for_each_entry_safe(fp, tmp, &fmb->phys, node) {
> -		list_del(&fp->node);
> -		kfree(fp);
> -	}
> -	ida_destroy(&phy_fixed_ida);
> +	for (int i = 0; i < PHY_MAX_ADDR; i++)
> +		fixed_phy_del(i);
>  }
>  module_exit(fixed_mdio_bus_exit);
>  
--
pw-bot: cr


      parent reply	other threads:[~2025-08-28 10:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-27 21:02 [PATCH v3 net] net: phy: fixed_phy: fix missing calls to gpiod_put in fixed_mdio_bus_exit Heiner Kallweit
2025-08-27 21:09 ` Russell King (Oracle)
2025-08-27 21:14   ` Florian Fainelli
2025-08-27 21:44     ` Russell King (Oracle)
2025-08-27 22:27       ` Andrew Lunn
2025-08-27 21:29   ` Heiner Kallweit
2025-08-27 21:46     ` Russell King (Oracle)
2025-08-28 10:31 ` Heiner Kallweit [this message]

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=fbdea48d-2bb4-4b84-8ac4-98480fa99143@gmail.com \
    --to=hkallweit1@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux@armlinux.org.uk \
    --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;
as well as URLs for NNTP newsgroup(s).