Skip to contentSkip to conversation

net: emac: Unmap emac phy base address and digital block

PATCH Applied Wanhui Fu 2 participants 2 messages Nov 26 – Dec 4

Subsystems (3)
lore
Share & tools
lore

Wanhui Fu

author
#0 lore raw

PATCH 1/1 net: emac: Unmap emac phy base address and digital block

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/[email protected]/

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")
---
 drivers/net/ethernet/qualcomm/emac/emac.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/net/ethernet/qualcomm/emac/emac.c +5 -1
index 699a8afc214a..aabc19a2a986 100644
@@ -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);
Signature · 1 line
2.25.1
#1 lore raw
This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:

Quoted 9 lines · On Thu, 26 Nov 2026 23:46:07 +0800 you wrote:

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/[email protected]/

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.

[...]

Here is the summary with links:
- net: emac: Unmap emac phy base address and digital block

    https://git.kernel.org/netdev/net-next/c/62ae6527877e

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html