[PATCH v6 07/16] PCI/AER: Initialize aer_err_info before using it
Bjorn Helgaas
helgaas at kernel.org
Wed May 21 00:27:07 AEST 2025
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 at 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 at 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!
More information about the Linuxppc-dev
mailing list