]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
scsi: aacraid: struct aac_ciss_phys_luns_resp: Replace 1-element array with flexible...
authorKees Cook <kees@kernel.org>
Thu, 11 Jul 2024 17:50:55 +0000 (10:50 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sat, 3 Aug 2024 01:29:09 +0000 (21:29 -0400)
Replace the deprecated[1] use of a 1-element array in struct
aac_ciss_phys_luns_resp with a modern flexible array.

No binary differences are present after this conversion.

Link: https://github.com/KSPP/linux/issues/79
Signed-off-by: Kees Cook <kees@kernel.org>
Link: https://lore.kernel.org/r/20240711175055.work.928-kees@kernel.org
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/aacraid/aachba.c
drivers/scsi/aacraid/aacraid.h

index b22857c6f3f4f93b92f3e1929a12ffb1084e8b64..497c6dd5df9112733a585a2704e7050f46cde9c5 100644 (file)
@@ -1833,7 +1833,7 @@ static int aac_get_safw_ciss_luns(struct aac_dev *dev)
        struct aac_ciss_phys_luns_resp *phys_luns;
 
        datasize = sizeof(struct aac_ciss_phys_luns_resp) +
-               (AAC_MAX_TARGETS - 1) * sizeof(struct _ciss_lun);
+               AAC_MAX_TARGETS * sizeof(struct _ciss_lun);
        phys_luns = kmalloc(datasize, GFP_KERNEL);
        if (phys_luns == NULL)
                goto out;
index 659e393c1033924fb0a1722601b487f1f022b4f4..6f0417f6f8a1108f467358c4fe7f7b422e9d8288 100644 (file)
@@ -322,7 +322,7 @@ struct aac_ciss_phys_luns_resp {
                u8      level3[2];
                u8      level2[2];
                u8      node_ident[16]; /* phys. node identifier */
-       } lun[1];                       /* List of phys. devices */
+       } lun[];                        /* List of phys. devices */
 };
 
 /*