From: Tobias Waldekranz Date: Tue, 18 Jan 2022 21:50:53 +0000 (+0100) Subject: net/fsl: xgmac_mdio: Fix incorrect iounmap when removing module X-Git-Tag: baikal/aarch64/sdk6.1~4833^2~1^2 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=ee9b899d60778fb2f0b94f2702652a28412ef9e4;p=kernel.git 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: 2e279d1950b4 ("net/fsl: introduce Freescale 10G MDIO driver") Signed-off-by: Tobias Waldekranz Reviewed-by: Andrew Lunn Signed-off-by: Jakub Kicinski --- diff --git a/drivers/net/ethernet/freescale/xgmac_mdio.c b/drivers/net/ethernet/freescale/xgmac_mdio.c index bf566ac3195b3..266e562bd67ae 100644 --- a/drivers/net/ethernet/freescale/xgmac_mdio.c +++ b/drivers/net/ethernet/freescale/xgmac_mdio.c @@ -331,9 +331,10 @@ err_ioremap: 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;