Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0e0de4a3 authored by Tobias Waldekranz's avatar Tobias Waldekranz Committed by Greg Kroah-Hartman
Browse files

net/fsl: xgmac_mdio: Fix incorrect iounmap when removing module



commit 3f7c239c7844d2044ed399399d97a5f1c6008e1b upstream.

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: 9f35a734 ("net/fsl: introduce Freescale 10G MDIO driver")
Signed-off-by: default avatarTobias Waldekranz <tobias@waldekranz.com>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2e293dba
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -301,9 +301,10 @@ static int xgmac_mdio_probe(struct platform_device *pdev)
static int xgmac_mdio_remove(struct platform_device *pdev)
{
	struct mii_bus *bus = platform_get_drvdata(pdev);
	struct mdio_fsl_priv *priv = bus->priv;

	mdiobus_unregister(bus);
	iounmap(bus->priv);
	iounmap(priv->mdio_base);
	mdiobus_free(bus);

	return 0;