Skip to content

Commit 4bd833b

Browse files
tititiou36gregkh
authored andcommitted
net: mdio: thunder: Fix a double free issue in the .remove function
[ Upstream commit a93a0a1 ] '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: 379d7ac ("phy: mdio-thunder: Add driver for Cavium Thunder SoC MDIO buses.") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Reviewed-by: Russell King <rmk+kernel@armlinux.org.uk> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 4246f7d commit 4bd833b

1 file changed

Lines changed: 0 additions & 1 deletion

File tree

‎drivers/net/mdio/mdio-thunder.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ static void thunder_mdiobus_pci_remove(struct pci_dev *pdev)
126126
continue;
127127

128128
mdiobus_unregister(bus->mii_bus);
129-
mdiobus_free(bus->mii_bus);
130129
oct_mdio_writeq(0, bus->register_base + SMI_EN);
131130
}
132131
pci_release_regions(pdev);

0 commit comments

Comments
 (0)