Skip to content

Commit 3f7c239

Browse files
wkzkuba-moo
authored andcommitted
net/fsl: xgmac_mdio: Fix incorrect iounmap when removing module
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: 9f35a73 ("net/fsl: introduce Freescale 10G MDIO driver") Signed-off-by: Tobias Waldekranz <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 0d375d6 commit 3f7c239

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/net/ethernet/freescale/xgmac_mdio.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,9 +331,10 @@ static int xgmac_mdio_probe(struct platform_device *pdev)
331331
static int xgmac_mdio_remove(struct platform_device *pdev)
332332
{
333333
struct mii_bus *bus = platform_get_drvdata(pdev);
334+
struct mdio_fsl_priv *priv = bus->priv;
334335

335336
mdiobus_unregister(bus);
336-
iounmap(bus->priv);
337+
iounmap(priv->mdio_base);
337338
mdiobus_free(bus);
338339

339340
return 0;

0 commit comments

Comments
 (0)