From 1b4ffcf8432f7945e0bd0571f10a2f2bd1dbd850 Mon Sep 17 00:00:00 2001 From: Hidetoshi Seto Date: Mon, 7 Sep 2009 17:09:58 +0900 Subject: 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 Signed-off-by: Jesse Barnes --- drivers/pci/pcie/aer/aerdrv_core.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/pci') diff --git a/drivers/pci/pcie/aer/aerdrv_core.c b/drivers/pci/pcie/aer/aerdrv_core.c index d3f6df40b0d..4d67db8dd0d 100644 --- a/drivers/pci/pcie/aer/aerdrv_core.c +++ b/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; + info->status = 0; + info->flags &= ~AER_TLP_HEADER_VALID_FLAG; + pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR); /* The device might not support AER */ -- cgit v1.2.3