GNU/Weeb Mailing List <[email protected]>
 help / color / mirror / Atom feed
* [ammarfaizi2-block:next/linux-next/akpm-base 54/86] drivers/scsi/aacraid/aachba.c:841:26: warning: array subscript 12 is outside array bounds of 'struct scsi_cmnd[1]'
@ 2022-02-26  9:29 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2022-02-26  9:29 UTC (permalink / raw)
  To: Martin K. Petersen
  Cc: kbuild-all, GNU/Weeb Mailing List, linux-kernel, Mark Brown

tree:   https://github.com/ammarfaizi2/linux-block next/linux-next/akpm-base
head:   96e1561b10f208e7e599796f3dc3717d357ab4a1
commit: 4d3f3f514ee62c43ee39f5596408b95cccb46fbb [54/86] Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git
config: microblaze-buildonly-randconfig-r003-20220225 (https://download.01.org/0day-ci/archive/20220226/[email protected]/config)
compiler: microblaze-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/ammarfaizi2/linux-block/commit/4d3f3f514ee62c43ee39f5596408b95cccb46fbb
        git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block
        git fetch --no-tags ammarfaizi2-block next/linux-next/akpm-base
        git checkout 4d3f3f514ee62c43ee39f5596408b95cccb46fbb
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=microblaze SHELL=/bin/bash drivers/scsi/aacraid/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>

All warnings (new ones prefixed by >>):

   drivers/scsi/aacraid/aachba.c: In function 'aac_probe_container':
>> drivers/scsi/aacraid/aachba.c:841:26: warning: array subscript 12 is outside array bounds of 'struct scsi_cmnd[1]' [-Warray-bounds]
     841 |         status = cmd_priv->status;
         |                          ^~
   drivers/scsi/aacraid/aachba.c:821:37: note: referencing an object of size 196 allocated by 'kzalloc.constprop'
     821 |         struct scsi_cmnd *scsicmd = kzalloc(sizeof(*scsicmd), GFP_KERNEL);
         |                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +841 drivers/scsi/aacraid/aachba.c

779dfcf6435b9a Phong Tran      2020-03-09  818  
fe76df4235986c Mark Haverkamp  2007-03-15  819  int aac_probe_container(struct aac_dev *dev, int cid)
fe76df4235986c Mark Haverkamp  2007-03-15  820  {
7afdb863799749 Bart Van Assche 2021-10-07  821  	struct scsi_cmnd *scsicmd = kzalloc(sizeof(*scsicmd), GFP_KERNEL);
76a3451b64c6d1 Bart Van Assche 2022-02-18  822  	struct aac_cmd_priv *cmd_priv = aac_priv(scsicmd);
7afdb863799749 Bart Van Assche 2021-10-07  823  	struct scsi_device *scsidev = kzalloc(sizeof(*scsidev), GFP_KERNEL);
fe76df4235986c Mark Haverkamp  2007-03-15  824  	int status;
fe76df4235986c Mark Haverkamp  2007-03-15  825  
fe76df4235986c Mark Haverkamp  2007-03-15  826  	if (!scsicmd || !scsidev) {
fe76df4235986c Mark Haverkamp  2007-03-15  827  		kfree(scsicmd);
fe76df4235986c Mark Haverkamp  2007-03-15  828  		kfree(scsidev);
fe76df4235986c Mark Haverkamp  2007-03-15  829  		return -ENOMEM;
fe76df4235986c Mark Haverkamp  2007-03-15  830  	}
^1da177e4c3f41 Linus Torvalds  2005-04-16  831  
fe76df4235986c Mark Haverkamp  2007-03-15  832  	scsicmd->device = scsidev;
fe76df4235986c Mark Haverkamp  2007-03-15  833  	scsidev->sdev_state = 0;
fe76df4235986c Mark Haverkamp  2007-03-15  834  	scsidev->id = cid;
fe76df4235986c Mark Haverkamp  2007-03-15  835  	scsidev->host = dev->scsi_host_ptr;
fe76df4235986c Mark Haverkamp  2007-03-15  836  
fe76df4235986c Mark Haverkamp  2007-03-15  837  	if (_aac_probe_container(scsicmd, aac_probe_container_callback1) == 0)
fe76df4235986c Mark Haverkamp  2007-03-15  838  		while (scsicmd->device == scsidev)
fe76df4235986c Mark Haverkamp  2007-03-15  839  			schedule();
802ae2f05b646c Salyzyn, Mark   2007-03-21  840  	kfree(scsidev);
76a3451b64c6d1 Bart Van Assche 2022-02-18 @841  	status = cmd_priv->status;
fe76df4235986c Mark Haverkamp  2007-03-15  842  	kfree(scsicmd);
^1da177e4c3f41 Linus Torvalds  2005-04-16  843  	return status;
^1da177e4c3f41 Linus Torvalds  2005-04-16  844  }
^1da177e4c3f41 Linus Torvalds  2005-04-16  845  

:::::: The code at line 841 was first introduced by commit
:::::: 76a3451b64c6d1718a651697670bd5dc557ed148 scsi: aacraid: Move the SCSI pointer to private command data

:::::: TO: Bart Van Assche <[email protected]>
:::::: CC: Martin K. Petersen <[email protected]>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-02-26  9:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-26  9:29 [ammarfaizi2-block:next/linux-next/akpm-base 54/86] drivers/scsi/aacraid/aachba.c:841:26: warning: array subscript 12 is outside array bounds of 'struct scsi_cmnd[1]' kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox