Skip to content

Commit a424b59

Browse files
committed
PCI/DPC: Initialize aer_err_info before using it
Previously the struct aer_err_info "info" was allocated on the stack without being initialized, so it contained junk except for the fields we explicitly set later. Initialize "info" at declaration so it starts as all zeros. Fixes: 8aefa9b ("PCI/DPC: Print AER status in DPC event handling") Signed-off-by: Bjorn Helgaas <[email protected]> Tested-by: Krzysztof Wilczyński <[email protected]> Reviewed-by: Kuppuswamy Sathyanarayanan <[email protected]> Reviewed-by: Ilpo Järvinen <[email protected]> Reviewed-by: Jonathan Cameron <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent 0af2f6b commit a424b59

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/pci/pcie/dpc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ static int dpc_get_aer_uncorrect_severity(struct pci_dev *dev,
258258
void dpc_process_error(struct pci_dev *pdev)
259259
{
260260
u16 cap = pdev->dpc_cap, status, source, reason, ext_reason;
261-
struct aer_err_info info;
261+
struct aer_err_info info = {};
262262

263263
pci_read_config_word(pdev, cap + PCI_EXP_DPC_STATUS, &status);
264264
pci_read_config_word(pdev, cap + PCI_EXP_DPC_SOURCE_ID, &source);

0 commit comments

Comments
 (0)