net/fsl: xgmac_mdio: Fix incorrect iounmap when removing module
commit3f7c239c78upstream. As reported by sparse: In the remove path, the driver would attempt to unmap its own priv pointer - instead of the io memory that it mapped in probe. Fixes:9f35a7342c("net/fsl: introduce Freescale 10G MDIO driver") Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
38c798384b
commit
d806eb5f4e
@@ -320,9 +320,10 @@ err_ioremap:
|
|||||||
static int xgmac_mdio_remove(struct platform_device *pdev)
|
static int xgmac_mdio_remove(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct mii_bus *bus = platform_get_drvdata(pdev);
|
struct mii_bus *bus = platform_get_drvdata(pdev);
|
||||||
|
struct mdio_fsl_priv *priv = bus->priv;
|
||||||
|
|
||||||
mdiobus_unregister(bus);
|
mdiobus_unregister(bus);
|
||||||
iounmap(bus->priv);
|
iounmap(priv->mdio_base);
|
||||||
mdiobus_free(bus);
|
mdiobus_free(bus);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user