Skip to content
This repository has been archived by the owner on Nov 21, 2022. It is now read-only.

Commit

Permalink
of: check for IS_ERR()
Browse files Browse the repository at this point in the history
get_phy_device() can return an ERR_PTR()

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
  • Loading branch information
error27 authored and glikely committed Apr 28, 2010
1 parent b0c0602 commit 9bd7371
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/of/of_mdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9bd7371

Please sign in to comment.