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

Bjorn Helgaas
2025-05-20T14:27:09Z

On Tue, May 20, 2025 at 01:39:06PM +0300, Ilpo Järvinen wrote:
> On Mon, 19 May 2025, Bjorn Helgaas wrote:
>
> > 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!