Skip to content
Commit 85d6306a authored by Mohamed Khalfella's avatar Mohamed Khalfella Committed by Greg Kroah-Hartman
Browse files

PCI/AER: Iterate over error counters instead of error strings

[ Upstream commit 5e6ae050 ]

Previously we iterated over AER stat *names*, e.g.,
aer_correctable_error_string[32], but the actual stat *counters* may not be
that large, e.g., pdev->aer_stats->dev_cor_errs[16], which means that we
printed junk in the sysfs stats files.

Iterate over the stat counter arrays instead of the names to avoid this
junk.

Also, added a build time check to make sure all
counters have entries in strings array.

Fixes: 0678e310

 ("PCI/AER: Simplify __aer_print_error()")
Link: https://lore.kernel.org/r/20220509181441.31884-1-mkhalfella@purestorage.com
Reported-by: default avatarMeeta Saggi <msaggi@purestorage.com>
Signed-off-by: default avatarMohamed Khalfella <mkhalfella@purestorage.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Reviewed-by: default avatarMeeta Saggi <msaggi@purestorage.com>
Reviewed-by: default avatarEric Badger <ebadger@purestorage.com>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent d83d886e
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment