@@ -800,6 +800,7 @@ static bool is_error_source(struct pci_dev *dev, struct aer_err_info *e_info)
int aer = dev->aer_cap;
u32 status, mask;
u16 reg16;
+ int ret;
/*
* When bus id is equal to 0, it might be a bad id
@@ -828,8 +829,8 @@ static bool is_error_source(struct pci_dev *dev, struct aer_err_info *e_info)
return false;
/* Check if AER is enabled */
- pcie_capability_read_word(dev, PCI_EXP_DEVCTL, ®16);
- if (!(reg16 & PCI_EXP_AER_FLAGS))
+ ret = pcie_capability_read_word(dev, PCI_EXP_DEVCTL, ®16);
+ if (ret || !(reg16 & PCI_EXP_AER_FLAGS))
return false;
if (!aer)