Skip to content

Commit 47699a2

Browse files
arndbmartinkpetersen
authored andcommitted
scsi: aacraid: Avoid -Warray-bounds warning
The one-element array in aac_aifcmd is actually meant as a flexible array, and causes an overflow warning that can be avoided using the normal flex arrays: drivers/scsi/aacraid/commsup.c:1166:17: error: array index 1 is past the end of the array (that has type 'u8[1]' (aka 'unsigned char[1]'), cast to '__le32 *' (aka 'unsigned int *')) [-Werror,-Warray-bounds] (((__le32 *)aifcmd->data)[1] == cpu_to_le32(3)); ^ ~ Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/20230703114851.1194510-1-arnd@kernel.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 89f7ef7 commit 47699a2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/scsi/aacraid/aacraid.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2617,7 +2617,7 @@ struct aac_hba_info {
26172617
struct aac_aifcmd {
26182618
__le32 command; /* Tell host what type of notify this is */
26192619
__le32 seqnum; /* To allow ordering of reports (if necessary) */
2620-
u8 data[1]; /* Undefined length (from kernel viewpoint) */
2620+
u8 data[]; /* Undefined length (from kernel viewpoint) */
26212621
};
26222622

26232623
/**

0 commit comments

Comments
 (0)