[dpdk-dev] [PATCH 09/10] net/e1000: add function return value check

Min Hu (Connor) humin29 at huawei.com
Mon Apr 19 15:34:48 CEST 2021


From: HongBo Zheng <zhenghongbo3 at huawei.com>

Return value of a function 'e1000_phy_has_link_generic'
called at e1000_kmrn_lock_loss_workaround_ich8lan is not
checked, but it is usually checked for this function.

This patch fix this problem.

Fixes: 5a32a257f957 ("e1000: more NICs in base driver")
Cc: stable at dpdk.org

Signed-off-by: HongBo Zheng <zhenghongbo3 at huawei.com>
Signed-off-by: Min Hu (Connor) <humin29 at huawei.com>
---
 drivers/net/e1000/base/e1000_ich8lan.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/e1000/base/e1000_ich8lan.c b/drivers/net/e1000/base/e1000_ich8lan.c
index 14f86b7..67adc46 100644
--- a/drivers/net/e1000/base/e1000_ich8lan.c
+++ b/drivers/net/e1000/base/e1000_ich8lan.c
@@ -5406,6 +5406,8 @@ STATIC s32 e1000_kmrn_lock_loss_workaround_ich8lan(struct e1000_hw *hw)
 	 * stability
 	 */
 	ret_val = e1000_phy_has_link_generic(hw, 1, 0, &link);
+	if (ret_val)
+		return ret_val;
 	if (!link)
 		return E1000_SUCCESS;
 
-- 
2.7.4



More information about the dev mailing list