Skip to content

Commit 9cc8d0e

Browse files
nehebPaolo Abeni
authored andcommitted
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: 23a890d ("net: mdio: Add the reset function for IPQ MDIO driver") Signed-off-by: Rosen Penev <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
1 parent 82159e6 commit 9cc8d0e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/net/mdio/mdio-ipq4019.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,11 @@ static int ipq4019_mdio_probe(struct platform_device *pdev)
352352
/* The platform resource is provided on the chipset IPQ5018 */
353353
/* This resource is optional */
354354
res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
355-
if (res)
355+
if (res) {
356356
priv->eth_ldo_rdy = devm_ioremap_resource(&pdev->dev, res);
357+
if (IS_ERR(priv->eth_ldo_rdy))
358+
return PTR_ERR(priv->eth_ldo_rdy);
359+
}
357360

358361
bus->name = "ipq4019_mdio";
359362
bus->read = ipq4019_mdio_read_c22;

0 commit comments

Comments
 (0)