Skip to content

Commit 2e35b43

Browse files
keesmartinkpetersen
authored andcommitted
scsi: aacraid: struct aac_ciss_phys_luns_resp: Replace 1-element array with flexible array
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: KSPP#79 [1] 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>
1 parent 575b9be commit 2e35b43

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/scsi/aacraid/aachba.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1833,7 +1833,7 @@ static int aac_get_safw_ciss_luns(struct aac_dev *dev)
18331833
struct aac_ciss_phys_luns_resp *phys_luns;
18341834

18351835
datasize = sizeof(struct aac_ciss_phys_luns_resp) +
1836-
(AAC_MAX_TARGETS - 1) * sizeof(struct _ciss_lun);
1836+
AAC_MAX_TARGETS * sizeof(struct _ciss_lun);
18371837
phys_luns = kmalloc(datasize, GFP_KERNEL);
18381838
if (phys_luns == NULL)
18391839
goto out;

drivers/scsi/aacraid/aacraid.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ struct aac_ciss_phys_luns_resp {
322322
u8 level3[2];
323323
u8 level2[2];
324324
u8 node_ident[16]; /* phys. node identifier */
325-
} lun[1]; /* List of phys. devices */
325+
} lun[]; /* List of phys. devices */
326326
};
327327

328328
/*

0 commit comments

Comments
 (0)