From: Hongbo Zheng Date: Thu, 29 Oct 2020 12:51:56 +0000 (+0800) Subject: net/hns3: check setting VF PCI bus return value X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=7ac3ae7649985c54a10f6904c298918e00a07e92;p=dpdk.git net/hns3: check setting VF PCI bus return value Currently hns3vf_reinit_dev only judge whether the return value of setting PCI bus function is not 0, while it will return a negative value 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 --- diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c index 9fb7941eb3..05a9341269 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; }