]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
PCI/AER: Return error if AER is not supported
authorKeith Busch <keith.busch@intel.com>
Tue, 19 Dec 2017 21:06:40 +0000 (14:06 -0700)
committerSeth Forshee <seth.forshee@canonical.com>
Fri, 16 Mar 2018 15:43:18 +0000 (10:43 -0500)
BugLink: http://bugs.launchpad.net/bugs/1756094
get_device_error_info() reads error information from registers in the AER
capability.  If we call it for a device that has no AER capability, it
should return an error, but previously it returned success.

Return 0 (error) if the device doesn't have an AER capability.

Signed-off-by: Keith Busch <keith.busch@intel.com>
[bhelgaas: changelog]
Signed-off-by: Bjorn Helgaas <helgaas@kernel.org>
(cherry picked from commit 0f6f1d9fca4ad91ce9b30dc0aa847b0947786261)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
drivers/pci/pcie/aer/aerdrv_core.c

index 3e354f224422a2438af353e692b12c869cd4876d..92ec13a09a2a1634c06831cc36fdcf5b4bd176e9 100644 (file)
@@ -661,7 +661,7 @@ static int get_device_error_info(struct pci_dev *dev, struct aer_err_info *info)
 
        /* The device might not support AER */
        if (!pos)
-               return 1;
+               return 0;
 
        if (info->severity == AER_CORRECTABLE) {
                pci_read_config_dword(dev, pos + PCI_ERR_COR_STATUS,