From: Dan Carpenter Date: Wed, 28 Apr 2010 07:07:29 +0000 (-0600) Subject: of: check for IS_ERR() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9bd73715a1f83f640937c121d22fa8dbaab73002;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git of: check for IS_ERR() get_phy_device() can return an ERR_PTR() Signed-off-by: Dan Carpenter Signed-off-by: Grant Likely --- diff --git a/drivers/of/of_mdio.c b/drivers/of/of_mdio.c index 18ecae4a4375..b4748337223b 100644 --- a/drivers/of/of_mdio.c +++ b/drivers/of/of_mdio.c @@ -69,7 +69,7 @@ int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np) } phy = get_phy_device(mdio, be32_to_cpup(addr)); - if (!phy) { + if (!phy || IS_ERR(phy)) { dev_err(&mdio->dev, "error probing PHY at address %i\n", *addr); continue;