Skip to content

Commit 7f8825b

Browse files
Yuan Canmstsirkin
authored andcommitted
vDPA/ifcvf: Fix pci_read_config_byte() return code handling
ifcvf_init_hw() uses pci_read_config_byte() that returns PCIBIOS_* codes. The error handling, however, assumes the codes are normal errnos because it checks for < 0. Convert the error check to plain non-zero check. Fixes: 5a2414b ("virtio: Intel IFC VF driver for VDPA") Signed-off-by: Yuan Can <[email protected]> Message-Id: <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]> Acked-by: Jason Wang <[email protected]> Acked-by: Zhu Lingshan <[email protected]>
1 parent 03a942f commit 7f8825b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/vdpa/ifcvf/ifcvf_base.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ int ifcvf_init_hw(struct ifcvf_hw *hw, struct pci_dev *pdev)
108108
u32 i;
109109

110110
ret = pci_read_config_byte(pdev, PCI_CAPABILITY_LIST, &pos);
111-
if (ret < 0) {
111+
if (ret) {
112112
IFCVF_ERR(pdev, "Failed to read PCI capability list\n");
113113
return -EIO;
114114
}

0 commit comments

Comments
 (0)