[<prev] [next>] [day] [month] [year] [list]
Message-ID: <3396d654-f32a-40bb-ba3b-9f749e5a29d5@gmail.com>
Date: Mon, 25 Aug 2025 22:44:26 +0200
From: Heiner Kallweit <hkallweit1@...il.com>
To: Andrew Lunn <andrew@...n.ch>, Andrew Lunn <andrew+netdev@...n.ch>,
Russell King - ARM Linux <linux@...linux.org.uk>,
Paolo Abeni <pabeni@...hat.com>, Jakub Kicinski <kuba@...nel.org>,
David Miller <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>
Cc: "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: [PATCH net] net: phy: fixed_phy: fix missing calls to gpiod_put in
fixed_mdio_bus_exit
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@...r.kernel.org
Signed-off-by: Heiner Kallweit <hkallweit1@...il.com>
---
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 f0e8a6c52..616dff089 100644
--- a/drivers/net/phy/fixed_phy.c
+++ b/drivers/net/phy/fixed_phy.c
@@ -342,16 +342,12 @@ 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);
- 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);
--
2.50.1
Powered by blists - more mailing lists