Thread (2 messages) flat view 2 messages, 2 authors, 2016-08-15
STALE3672d

[PATCH -next] net: phy: Fix return value check in xgmiitorgmii_probe()

From: Wei Yongjun <hidden>
Date: 2016-08-15 22:34:57
Also in: netdev
Subsystem: ethernet phy library, networking drivers, the rest · Maintainers: Andrew Lunn, Heiner Kallweit, Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

In case of error, the function of_parse_phandle() returns NULL
pointer not ERR_PTR(). The IS_ERR() test in the return value check
should be replaced with NULL test.

Signed-off-by: Wei Yongjun <redacted>
---
 drivers/net/phy/xilinx_gmii2rgmii.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/phy/xilinx_gmii2rgmii.c b/drivers/net/phy/xilinx_gmii2rgmii.c
index 8e980ad..cad6e19 100644
--- a/drivers/net/phy/xilinx_gmii2rgmii.c
+++ b/drivers/net/phy/xilinx_gmii2rgmii.c
@@ -67,7 +67,7 @@ int xgmiitorgmii_probe(struct mdio_device *mdiodev)
 		return -ENOMEM;
 
 	phy_node = of_parse_phandle(np, "phy-handle", 0);
-	if (IS_ERR(phy_node)) {
+	if (!phy_node) {
 		dev_err(dev, "Couldn't parse phy-handle\n");
 		return -ENODEV;
 	}
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help