lkml.org 
[lkml]   [2022]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.10 512/563] net/fsl: xgmac_mdio: Fix incorrect iounmap when removing module
    Date
    From: Tobias Waldekranz <tobias@waldekranz.com>

    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: 9f35a7342cff ("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>
    ---
    drivers/net/ethernet/freescale/xgmac_mdio.c | 3 ++-
    1 file changed, 2 insertions(+), 1 deletion(-)

    --- a/drivers/net/ethernet/freescale/xgmac_mdio.c
    +++ b/drivers/net/ethernet/freescale/xgmac_mdio.c
    @@ -320,9 +320,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;

    \
     
     \ /
      Last update: 2022-01-25 04:09    [W:5.960 / U:0.568 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site