From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 31110A04B5; Thu, 29 Oct 2020 13:50:13 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 98C6ACC19; Thu, 29 Oct 2020 13:49:02 +0100 (CET) Received: from szxga07-in.huawei.com (szxga07-in.huawei.com [45.249.212.35]) by dpdk.org (Postfix) with ESMTP id 08869CB42 for ; Thu, 29 Oct 2020 13:48:50 +0100 (CET) Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4CMQH42FBgz70LD for ; Thu, 29 Oct 2020 20:48:48 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.487.0; Thu, 29 Oct 2020 20:48:37 +0800 From: Lijun Ou To: CC: , Date: Thu, 29 Oct 2020 20:49:11 +0800 Message-ID: <1603975751-27955-9-git-send-email-oulijun@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1603975751-27955-1-git-send-email-oulijun@huawei.com> References: <1603973875-8431-1-git-send-email-oulijun@huawei.com> <1603975751-27955-1-git-send-email-oulijun@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH v2 8/8] net/hns3: fix return value check of setting VF bus X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Hongbo Zheng Currently hns3vf_reinit_dev only judge whether the return value of hns3vf_set_bus_master() is not 0, while hns3vf_set_bus_master() will return a negative when execute failed. Fixes: 243651cb6c8c ("net/hns3: check PCI config space reads") Cc: stable@dpdk.org Signed-off-by: Hongbo Zheng Signed-off-by: Lijun Ou --- V1->V2: -fix checkpatch warning --- drivers/net/hns3/hns3_ethdev_vf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c index 9fb7941..05a9341 100644 --- a/drivers/net/hns3/hns3_ethdev_vf.c +++ b/drivers/net/hns3/hns3_ethdev_vf.c @@ -2619,7 +2619,7 @@ hns3vf_reinit_dev(struct hns3_adapter *hns) if (hw->reset.level == HNS3_VF_FULL_RESET) { rte_intr_disable(&pci_dev->intr_handle); ret = hns3vf_set_bus_master(pci_dev, true); - if (ret) { + if (ret < 0) { hns3_err(hw, "failed to set pci bus, ret = %d", ret); return ret; } -- 2.7.4