Commit 54e19bc74f33 ("net: qcom/emac: do not use devm on internal phy pdev") used ioremap instead of devm_* in emac_sgmii_config(). https://lore.kernel.org/all/1474640854-1698-1-git-send-email-timur@codeaurora.org/ The error handling is also added inside emac_sgmii_config() and emac_remove(), but missed in emac_probe(). Add corresponding iounmap() in the error handling path. Found it by a self-developed static analysis tool and compile- test passed. Fixes: 54e19bc74f33 ("net: qcom/emac: do not use devm on internal phy pdev") Signed-off-by: Wanhui Fu --- drivers/net/ethernet/qualcomm/emac/emac.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/qualcomm/emac/emac.c b/drivers/net/ethernet/qualcomm/emac/emac.c index 699a8afc214a..aabc19a2a986 100644 --- a/drivers/net/ethernet/qualcomm/emac/emac.c +++ b/drivers/net/ethernet/qualcomm/emac/emac.c @@ -660,7 +660,7 @@ static int emac_probe(struct platform_device *pdev) ret = emac_clks_phase2_init(pdev, adpt); if (ret) { dev_err(&pdev->dev, "could not initialize clocks\n"); - goto err_undo_mdiobus; + goto err_undo_sgmii; } /* set hw features */ @@ -707,6 +707,10 @@ static int emac_probe(struct platform_device *pdev) err_undo_napi: netif_napi_del(&adpt->rx_q.napi); +err_undo_sgmii: + if (adpt->phy.digital) + iounmap(adpt->phy.digital); + iounmap(adpt->phy.base); err_undo_mdiobus: put_device(&adpt->phydev->mdio.dev); mdiobus_unregister(adpt->mii_bus); -- 2.25.1