Thread (68 messages) flat view 68 messages, 5 authors, 2025-05-21

Re: [PATCH v6 01/16] PCI/DPC: Initialize aer_err_info before using it

From: Sathyanarayanan Kuppuswamy <sathyanarayanan.kuppuswamy@linux.intel.com>
Date: 2025-05-19 22:41:53
Also in: linux-pci, lkml

Hi,

On 5/19/25 2:35 PM, Bjorn Helgaas wrote:
From: Bjorn Helgaas <bhelgaas@google.com>

Previously the struct aer_err_info "info" was allocated on the stack
/s/Previously/Currently ?
without being initialized, so it contained junk except for the fields we
explicitly set later.

Initialize "info" at declaration so it starts as all zeroes.
/s/zeroes/zeros

Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
quoted hunk ↗ jump to hunk
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
  drivers/pci/pcie/dpc.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pci/pcie/dpc.c b/drivers/pci/pcie/dpc.c
index df42f15c9829..fe7719238456 100644
--- a/drivers/pci/pcie/dpc.c
+++ b/drivers/pci/pcie/dpc.c
@@ -258,7 +258,7 @@ static int dpc_get_aer_uncorrect_severity(struct pci_dev *dev,
  void dpc_process_error(struct pci_dev *pdev)
  {
  	u16 cap = pdev->dpc_cap, status, source, reason, ext_reason;
-	struct aer_err_info info;
+	struct aer_err_info info = { 0 };
  
  	pci_read_config_word(pdev, cap + PCI_EXP_DPC_STATUS, &status);
  	pci_read_config_word(pdev, cap + PCI_EXP_DPC_SOURCE_ID, &source);
-- 
Sathyanarayanan Kuppuswamy
Linux Kernel Developer

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help