Re: [PATCH][RESEND] scsi: megaraid: Avoid mismatched storage type sizes
From: Martin K. Petersen
Date: Mon Jan 10 2022 - 17:05:02 EST
On Wed, 5 Jan 2022 09:36:33 -0800, Kees Cook wrote:
> Remove needless use of mbox_t, replacing with just struct
> mbox_out. Silences compiler warnings under a -Warray-bounds build:
>
> drivers/scsi/megaraid.c: In function 'megaraid_probe_one':
> drivers/scsi/megaraid.c:3615:30: error: array subscript 'mbox_t[0]' is partly outside array bounds of 'unsigned char[15]' [-Werror=array-bounds]
> 3615 | mbox->m_out.xferaddr = (u32)adapter->buf_dma_handle;
> | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/scsi/megaraid.c:3599:23: note: while referencing 'raw_mbox'
> 3599 | unsigned char raw_mbox[sizeof(struct mbox_out)];
> | ^~~~~~~~
>
> [...]
Applied to 5.17/scsi-queue, thanks!
[1/1] scsi: megaraid: Avoid mismatched storage type sizes
https://git.kernel.org/mkp/scsi/c/315d049ad195
--
Martin K. Petersen Oracle Linux Engineering