Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

of: check for IS_ERR()

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>

authored by

Dan Carpenter and committed by
Grant Likely
9bd73715 b0c06027

+1 -1
+1 -1
drivers/of/of_mdio.c
··· 69 69 } 70 70 71 71 phy = get_phy_device(mdio, be32_to_cpup(addr)); 72 - if (!phy) { 72 + if (!phy || IS_ERR(phy)) { 73 73 dev_err(&mdio->dev, "error probing PHY at address %i\n", 74 74 *addr); 75 75 continue;