mpt3sas_base.c:5396:40: warning: array subscript ‘Mpi2SasIOUnitPage1_t is partly outside array bounds of ‘unsigned char[20]’

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When compiling current kernel git head for the parisc platform I face compiler warnings:

  CC      drivers/scsi/mpt3sas/mpt3sas_base.o
In file included from linux/include/linux/swab.h:5,
                 from linux/include/uapi/linux/byteorder/big_endian.h:14,
                 from linux/include/linux/byteorder/big_endian.h:5,
                 from linux/arch/parisc/include/uapi/asm/byteorder.h:5,
                 from linux/arch/parisc/include/asm/bitops.h:11,
                 from linux/include/linux/bitops.h:33,
                 from linux/include/linux/kernel.h:22,
                 from linux/drivers/scsi/mpt3sas/mpt3sas_base.c:46:
linux/drivers/scsi/mpt3sas/mpt3sas_base.c: In function ‘_base_make_ioc_operational’:
linux/drivers/scsi/mpt3sas/mpt3sas_base.c:5396:40: warning: array subscript ‘Mpi2SasIOUnitPage1_t {aka struct _MPI2_CONFIG_PAGE_SASIOUNIT_1}[0]’ is partly outside array bounds of ‘unsigned char[20]’ [-Warray-bounds]
 5396 |             (le16_to_cpu(sas_iounit_pg1->SASWideMaxQueueDepth)) ?
linux/include/uapi/linux/swab.h:105:39: note: in definition of macro ‘__swab16’
  105 |         (__builtin_constant_p((__u16)(x)) ?     \
      |                                       ^
linux/include/linux/byteorder/generic.h:91:21: note: in expansion of macro ‘__le16_to_cpu’
   91 | #define le16_to_cpu __le16_to_cpu
      |                     ^~~~~~~~~~~~~
linux/drivers/scsi/mpt3sas/mpt3sas_base.c:5396:14: note: in expansion of macro ‘le16_to_cpu’
 5396 |             (le16_to_cpu(sas_iounit_pg1->SASWideMaxQueueDepth)) ?
      |              ^~~~~~~~~~~
linux/drivers/scsi/mpt3sas/mpt3sas_base.c:5382:26: note: referencing an object of size 20 allocated by ‘kzalloc’
 5382 |         sas_iounit_pg1 = kzalloc(sz, GFP_KERNEL);
      |                          ^~~~~~~~~~~~~~~~~~~~~~~
In file included from linux/include/linux/swab.h:5,
                 from linux/include/uapi/linux/byteorder/big_endian.h:14,
                 from linux/include/linux/byteorder/big_endian.h:5,
                 from linux/arch/parisc/include/uapi/asm/byteorder.h:5,
                 from linux/arch/parisc/include/asm/bitops.h:11,
                 from linux/include/linux/bitops.h:33,
                 from linux/include/linux/kernel.h:22,
                 from linux/drivers/scsi/mpt3sas/mpt3sas_base.c:46:
linux/drivers/scsi/mpt3sas/mpt3sas_base.c:5400:40: warning: array subscript ‘Mpi2SasIOUnitPage1_t {aka struct _MPI2_CONFIG_PAGE_SASIOUNIT_1}[0]’ is partly outside array bounds of ‘unsigned char[20]’ [-Warray-bounds]
 5400 |             (le16_to_cpu(sas_iounit_pg1->SASNarrowMaxQueueDepth)) ?
linux/include/uapi/linux/swab.h:105:39: note: in definition of macro ‘__swab16’
  105 |         (__builtin_constant_p((__u16)(x)) ?     \
      |                                       ^
linux/include/linux/byteorder/generic.h:91:21: note: in expansion of macro ‘__le16_to_cpu’
   91 | #define le16_to_cpu __le16_to_cpu
      |                     ^~~~~~~~~~~~~
linux/drivers/scsi/mpt3sas/mpt3sas_base.c:5400:14: note: in expansion of macro ‘le16_to_cpu’
 5400 |             (le16_to_cpu(sas_iounit_pg1->SASNarrowMaxQueueDepth)) ?
      |              ^~~~~~~~~~~
linux/drivers/scsi/mpt3sas/mpt3sas_base.c:5382:26: note: referencing an object of size 20 allocated by ‘kzalloc’
 5382 |         sas_iounit_pg1 = kzalloc(sz, GFP_KERNEL);
      |                          ^~~~~~~~~~~~~~~~~~~~~~~
linux/drivers/scsi/mpt3sas/mpt3sas_base.c:5403:43: warning: array subscript ‘Mpi2SasIOUnitPage1_t {aka struct _MPI2_CONFIG_PAGE_SASIOUNIT_1}[0]’ is partly outside array bounds of ‘unsigned char[20]’ [-Warray-bounds]
 5403 |         ioc->max_sata_qd = (sas_iounit_pg1->SATAMaxQDepth) ?
      |                            ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
linux/drivers/scsi/mpt3sas/mpt3sas_base.c:5382:26: note: referencing an object of size 20 allocated by ‘kzalloc’
 5382 |         sas_iounit_pg1 = kzalloc(sz, GFP_KERNEL);
      |                          ^~~~~~~~~~~~~~~~~~~~~~~


Helge




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux