diff mbox series

[2/3] rasdaemon: mce-amd-smca: properly limit bank types

Message ID 20220720143957.923005739@redhat.com (mailing list archive)
State New, archived
Headers show
Series rasdaemon: misc fixes | expand

Commit Message

'arozansk@redhat.com' July 20, 2022, 2:39 p.m. UTC
Found with covscan.

Signed-off-by: Aristeu Rozanski <arozansk@redhat.com>
diff mbox series

Patch

diff --git a/mce-amd-smca.c b/mce-amd-smca.c
index f3379fc..27ca8aa 100644
--- a/mce-amd-smca.c
+++ b/mce-amd-smca.c
@@ -584,7 +584,7 @@  static void decode_smca_error(struct mce_event *e)
 		return;
 	}
 
-	if (bank_type >= MAX_NR_BANKS) {
+	if (bank_type >= N_SMCA_BANK_TYPES) {
 		strcpy(e->mcastatus_msg, "Don't know how to decode this bank");
 		return;
 	}