From 7af7491282d560862cc7efb395387005eba829e8 Mon Sep 17 00:00:00 2001 From: shenjian Date: Mon, 1 Jul 2019 15:02:07 +0800 Subject: [PATCH] net: hns3: fix return value error when query mac link status fail driver inclusion category: bugfix bugzilla: NA CVE: NA Currently, PF queries the mac link status per second by calling function hclge_get_mac_link_status(). It return the error code when failed to send cmdq command to firmware. It's incorrect, because this return value is used as the mac link status, which 0 means link down, and none-zero means link up. This patch fixes it by changing the return value to 0. Feature or Bugfix:Bugfix Signed-off-by: shenjian (K) Reviewed-by: lipeng Reviewed-by: Yang Yingliang Signed-off-by: Yang Yingliang --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 2 +- 1 file changed, 1 insertion(+), 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 9a9f33341108..5805fb7b9626 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -2615,7 +2615,7 @@ static int hclge_get_mac_link_status(struct hclge_dev *hdev) if (ret) { dev_err(&hdev->pdev->dev, "get link status cmd failed %d\n", ret); - return ret; + return 0; } req = (struct hclge_link_status_cmd *)desc.data; -- GitLab