From: Greg Thelen Date: Sun, 17 Apr 2011 15:22:21 +0000 (-0700) Subject: PCI: check pci_vpd_pci22_wait() return X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=d97ecd819137118b4686a753415f93215a6edacf;p=openwrt%2Fstaging%2Fblogic.git 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. Signed-off-by: Greg Thelen Signed-off-by: Jesse Barnes --- diff --git a/drivers/pci/access.c b/drivers/pci/access.c index 531bc697d800..0c1f20f570a4 100644 --- a/drivers/pci/access.c +++ b/drivers/pci/access.c @@ -324,6 +324,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); }