Blame SOURCES/e8b97ec14a11764fedfea50bd4d96ddda43c7fc1.patch

7b5b3d
commit e8b97ec14a11764fedfea50bd4d96ddda43c7fc1
7b5b3d
Author: Aristeu Rozanski <arozansk@redhat.com>
7b5b3d
Date:   Thu Jan 19 08:45:57 2023 -0500
7b5b3d
7b5b3d
    rasdaemon: mce-amd-smca: properly limit bank types
7b5b3d
    
7b5b3d
    Found with covscan.
7b5b3d
    
7b5b3d
    Signed-off-by: Aristeu Rozanski <arozansk@redhat.com>
7b5b3d
    Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
7b5b3d
7b5b3d
diff --git a/mce-amd-smca.c b/mce-amd-smca.c
7b5b3d
index f3379fc..27ca8aa 100644
7b5b3d
--- a/mce-amd-smca.c
7b5b3d
+++ b/mce-amd-smca.c
7b5b3d
@@ -584,7 +584,7 @@ static void decode_smca_error(struct mce_event *e)
7b5b3d
 		return;
7b5b3d
 	}
7b5b3d
 
7b5b3d
-	if (bank_type >= MAX_NR_BANKS) {
7b5b3d
+	if (bank_type >= N_SMCA_BANK_TYPES) {
7b5b3d
 		strcpy(e->mcastatus_msg, "Don't know how to decode this bank");
7b5b3d
 		return;
7b5b3d
 	}