Skip to contentSkip to conversation

PCI: check pci_vpd_pci22_wait() return

PATCH In review Greg Thelen 2 participants 2 messages Apr 17, 2011 – Apr 20, 2011 PCI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PCI: check pci_vpd_pci22_wait() return

pci_vpd_pci22_write() calls pci_vpd_pci22_wait() after writing PCI_VPD_DATA and PCI_VPD_ADDR to wait for the VPD operation to complete. The result pci_vpd_pci22_wait() was not checked for error.

This change checks for error.

---
 drivers/pci/access.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/pci/access.c +2 -0
index 502610b..fdaa42a 100644
@@ -334,6 +334,8 @@ static ssize_t pci_vpd_pci22_write(struct pci_dev *dev, loff_t pos, size_t count
 		vpd->busy = true;
 		vpd->flag = 0;
 		ret = pci_vpd_pci22_wait(dev);
+		if (ret < 0)
+			break;
 
 		pos += sizeof(u32);
 	}
Signature · 1 line
1.7.3.1
#1 lore raw
Quoted 5 lines · On Sun, 17 Apr 2011 08:22:21 -0700 Greg Thelen <[email protected]> wrote:

pci_vpd_pci22_write() calls pci_vpd_pci22_wait() after writing PCI_VPD_DATA and PCI_VPD_ADDR to wait for the VPD operation to complete. The result pci_vpd_pci22_wait() was not checked for error.

This change checks for error.

Applied the two return value fixes to linux-next, thanks.

Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center