linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2] net: mdio: thunder: Fix a double free issue in the .remove function
@ 2021-05-13  7:44 Christophe JAILLET
  2021-05-13  8:11 ` Russell King - ARM Linux admin
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Christophe JAILLET @ 2021-05-13  7:44 UTC (permalink / raw)
  To: andrew, hkallweit1, linux, davem, kuba, david.daney
  Cc: netdev, linux-kernel, kernel-janitors, Christophe JAILLET

'bus->mii_bus' have been allocated with 'devm_mdiobus_alloc_size()' in the
probe function. So it must not be freed explicitly or there will be a
double free.

Remove the incorrect 'mdiobus_free' in the remove function.

Fixes: 379d7ac7ca31 ("phy: mdio-thunder: Add driver for Cavium Thunder SoC MDIO buses.")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
v2: indicate in the subject which mdio bus driver has a double free
---
 drivers/net/mdio/mdio-thunder.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/net/mdio/mdio-thunder.c b/drivers/net/mdio/mdio-thunder.c
index cb1761693b69..822d2cdd2f35 100644
--- a/drivers/net/mdio/mdio-thunder.c
+++ b/drivers/net/mdio/mdio-thunder.c
@@ -126,7 +126,6 @@ static void thunder_mdiobus_pci_remove(struct pci_dev *pdev)
 			continue;
 
 		mdiobus_unregister(bus->mii_bus);
-		mdiobus_free(bus->mii_bus);
 		oct_mdio_writeq(0, bus->register_base + SMI_EN);
 	}
 	pci_release_regions(pdev);
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-05-13 20:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-13  7:44 [PATCH V2] net: mdio: thunder: Fix a double free issue in the .remove function Christophe JAILLET
2021-05-13  8:11 ` Russell King - ARM Linux admin
2021-05-13  9:37 ` Russell King - ARM Linux admin
2021-05-13 12:23 ` Andrew Lunn
2021-05-13 20:20 ` patchwork-bot+netdevbpf

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).