浏览代码

PCI: pcie, aer: init struct aer_err_info for reuse

In case of multiple errors, struct aer_err_info would be reused among
all reported devices.  So the info->status should be initialized before
recycled.  Otherwise error of one device might be reported as the error
of another device.  Also info->flags has similar problem on reporting
TLP header.

Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Hidetoshi Seto 16 年之前
父节点
当前提交
1b4ffcf843
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      drivers/pci/pcie/aer/aerdrv_core.c

+ 3 - 0
drivers/pci/pcie/aer/aerdrv_core.c

@@ -708,6 +708,9 @@ static int get_device_error_info(struct pci_dev *dev, struct aer_err_info *info)
 {
 {
 	int pos;
 	int pos;
 
 
+	info->status = 0;
+	info->flags &= ~AER_TLP_HEADER_VALID_FLAG;
+
 	pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR);
 	pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR);
 
 
 	/* The device might not support AER */
 	/* The device might not support AER */