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

Re: [PATCH v6 07/16] PCI/AER: Initialize aer_err_info before using it

From: Bjorn Helgaas <helgaas@kernel.org>
Date: 2025-05-20 14:27:09
Also in: linux-pci, lkml

On Tue, May 20, 2025 at 01:39:06PM +0300, Ilpo Järvinen wrote:
On Mon, 19 May 2025, Bjorn Helgaas wrote:
quoted
From: Bjorn Helgaas <bhelgaas@google.com>

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

Initialize "e_info" at declaration with a designated initializer list,
which initializes the other members to zero.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
 drivers/pci/pcie/aer.c | 37 ++++++++++++++++---------------------
 1 file changed, 16 insertions(+), 21 deletions(-)
diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c
index 95a4cab1d517..40f003eca1c5 100644
--- a/drivers/pci/pcie/aer.c
+++ b/drivers/pci/pcie/aer.c
@@ -1281,7 +1281,7 @@ static void aer_isr_one_error(struct aer_rpc *rpc,
 		struct aer_err_source *e_src)
Unrelated to this change, these would fit on a single line.
Thanks, fixed!
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help