Skip to contentSkip to conversation

net: mdio-ipq4019: add missing error check

PATCH Applied Rosen Penev 3 participants 3 messages Nov 21, 2024 – Nov 26, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 net: mdio-ipq4019: add missing error check

If an optional resource is found but fails to remap, return on failure. Avoids any potential problems when using the iomapped resource as the assumption is that it's available.

Fixes 23a890d493e3 ("net: mdio: Add the reset function for IPQ MDIO driver")

---
v2: reword and return on error instead.

 drivers/net/mdio/mdio-ipq4019.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/mdio/mdio-ipq4019.c +4 -1
index dd3ed2d6430b..d9a94df482d9 100644
@@ -352,8 +352,11 @@ static int ipq4019_mdio_probe(struct platform_device *pdev)
 	/* The platform resource is provided on the chipset IPQ5018 */
 	/* This resource is optional */
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-	if (res)
+	if (res) {
 		priv->eth_ldo_rdy = devm_ioremap_resource(&pdev->dev, res);
+		if (IS_ERR(priv->eth_ldo_rdy))
+			return PTR_ERR(priv->eth_ldo_rdy);
+	}
 
 	bus->name = "ipq4019_mdio";
 	bus->read = ipq4019_mdio_read_c22;
Signature · 1 line
2.47.0
maintainer Reviewed-by on v2 1/1
#1 lore raw
Quoted 6 lines · Rosen Penev

If an optional resource is found but fails to remap, return on failure. Avoids any potential problems when using the iomapped resource as the assumption is that it's available.

Fixes 23a890d493e3 ("net: mdio: Add the reset function for IPQ MDIO driver")

Andrew

#2 lore raw
In reply to Rosen Penev
This patch was applied to netdev/net.git (main) by Paolo Abeni <[email protected]>:

Hello:

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

Quoted 8 lines · On Thu, 21 Nov 2024 11:31:52 -0800 you wrote:

If an optional resource is found but fails to remap, return on failure. Avoids any potential problems when using the iomapped resource as the assumption is that it's available.

Fixes 23a890d493e3 ("net: mdio: Add the reset function for IPQ MDIO driver")

[...]

Here is the summary with links:
- [PATCHv2,net] net: mdio-ipq4019: add missing error check

    https://git.kernel.org/netdev/net/c/9cc8d0ecdd2a

You are awesome, thank you!

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