diff mbox

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

Message ID 1471300497-15066-1-git-send-email-weiyj.lk@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Wei Yongjun Aug. 15, 2016, 10:34 p.m. UTC
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 <weiyj.lk@gmail.com>
---
 drivers/net/phy/xilinx_gmii2rgmii.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Miller Aug. 15, 2016, 11:34 p.m. UTC | #1
From: Wei Yongjun <weiyj.lk@gmail.com>
Date: Mon, 15 Aug 2016 22:34:57 +0000

> 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 <weiyj.lk@gmail.com>

Applied.
diff mbox

Patch

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;
 	}