public inbox for gwml@vger.gnuweeb.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: kbuild-all@lists.01.org,
	GNU/Weeb Mailing List <gwml@vger.gnuweeb.org>,
	linux-kernel@vger.kernel.org, Mark Brown <broonie@kernel.org>
Subject: [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]'
Date: Sat, 26 Feb 2022 17:29:26 +0800	[thread overview]
Message-ID: <202202261717.NzgEagBk-lkp@intel.com> (raw)

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/202202261717.NzgEagBk-lkp@intel.com/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 <lkp@intel.com>

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 <bvanassche@acm.org>
:::::: CC: Martin K. Petersen <martin.petersen@oracle.com>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

                 reply	other threads:[~2022-02-26  9:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202202261717.NzgEagBk-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=broonie@kernel.org \
    --cc=gwml@vger.gnuweeb.org \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox