From: Guangbin Huang huangguangbin2@huawei.com
driver inclusion category: bugfix bugzilla: NA CVE: NA
This patch adds error process in hclge_mac_link_status_wait() function, if failed to get mac link status then return result directly.
Signed-off-by: Guangbin Huang huangguangbin2@huawei.com Reviewed-by: Peng Li lipeng321@huawei.com Reviewed-by: Zhong Zhaohui zhongzhaohui@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index dc12141..5bb1979 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -6553,8 +6553,11 @@ static int hclge_mac_link_status_wait(struct hclge_dev *hdev, int link_ret)
do { ret = hclge_get_mac_link_status(hdev); - if (ret == link_ret) + if (ret < 0) + return ret; + else if (ret == link_ret) return 0; + msleep(HCLGE_LINK_STATUS_MS); } while (++i < HCLGE_MAC_LINK_STATUS_NUM); return -EBUSY;