On Wed, Oct 01, 2025 at 04:36:57PM -0500, Bjorn Helgaas wrote: > On Mon, Sep 29, 2025 at 02:15:47AM -0700, Breno Leitao wrote: > > Similarly to pci_dev_aer_stats_incr(), pci_print_aer() may be called > > when dev->aer_info is NULL. Add a NULL check before proceeding to avoid > > calling aer_ratelimit() with a NULL aer_info pointer, returning 1, which > > does not rate limit, given this is fatal. > > > > This prevents a kernel crash triggered by dereferencing a NULL pointer > > in aer_ratelimit(), ensuring safer handling of PCI devices that lack > > AER info. This change aligns pci_print_aer() with pci_dev_aer_stats_incr() > > which already performs this NULL check. > > > > Cc: [email protected] > > Fixes: a57f2bfb4a5863 ("PCI/AER: Ratelimit correctable and non-fatal error > > logging") > > Signed-off-by: Breno Leitao <[email protected]> > > Thanks, Breno, I applied this to pci/aer for v6.18. I added a little > more detail to the commit log because the path where we hit this is a > bit obscure. Please take a look and see if it makes sense:
Thanks! That’s exactly what I would have written if I actually knew what I was doing. :-)
