[PATCH] netdev: octeon: fix return value check in octeon_mgmt_init_phy()

Subsystems: networking drivers, the rest

STALE5073d

2 messages, 2 authors, 2012-09-28 · open the first message on its own page

[PATCH] netdev: octeon: fix return value check in octeon_mgmt_init_phy()

From: Wei Yongjun <hidden>
Date: 2012-09-28 05:04:21

From: Wei Yongjun <redacted>

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

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <redacted>
---
 drivers/net/ethernet/octeon/octeon_mgmt.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/octeon/octeon_mgmt.c b/drivers/net/ethernet/octeon/octeon_mgmt.c
index c42bbb1..a688a2d 100644
--- a/drivers/net/ethernet/octeon/octeon_mgmt.c
+++ b/drivers/net/ethernet/octeon/octeon_mgmt.c
@@ -722,10 +722,8 @@ static int octeon_mgmt_init_phy(struct net_device *netdev)
 				   octeon_mgmt_adjust_link, 0,
 				   PHY_INTERFACE_MODE_MII);
 
-	if (IS_ERR(p->phydev)) {
-		p->phydev = NULL;
+	if (!p->phydev)
 		return -1;
-	}
 
 	phy_start_aneg(p->phydev);
 

Re: [PATCH] netdev: octeon: fix return value check in octeon_mgmt_init_phy()

From: David Miller <davem@davemloft.net>
Date: 2012-09-28 05:18:52

From: Wei Yongjun <redacted>
Date: Fri, 28 Sep 2012 13:04:21 +0800
From: Wei Yongjun <redacted>

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

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <redacted>
Applied, thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help