mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-25 20:10:23 +09:00
net: mdio: octeon: Fix some double free issues
[ Upstream commite1d027dd97] 'bus->mii_bus' has 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 error handling path of the probe function and in remove function. Suggested-By: Andrew Lunn <andrew@lunn.ch> Fixes:35d2aeac98("phy: mdio-octeon: Use devm_mdiobus_alloc_size()") 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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
4bd833bb5e
commit
ada298f861
@@ -71,7 +71,6 @@ static int octeon_mdiobus_probe(struct platform_device *pdev)
|
||||
|
||||
return 0;
|
||||
fail_register:
|
||||
mdiobus_free(bus->mii_bus);
|
||||
smi_en.u64 = 0;
|
||||
oct_mdio_writeq(smi_en.u64, bus->register_base + SMI_EN);
|
||||
return err;
|
||||
@@ -85,7 +84,6 @@ static int octeon_mdiobus_remove(struct platform_device *pdev)
|
||||
bus = platform_get_drvdata(pdev);
|
||||
|
||||
mdiobus_unregister(bus->mii_bus);
|
||||
mdiobus_free(bus->mii_bus);
|
||||
smi_en.u64 = 0;
|
||||
oct_mdio_writeq(smi_en.u64, bus->register_base + SMI_EN);
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user