From: kernel test robot <lkp@intel.com>
To: Karan Tilak Kumar <kartilak@cisco.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Sesidhar Baddela <sebaddel@cisco.com>,
Arulprabhu Ponnusamy <arulponn@cisco.com>
Subject: drivers/scsi/fnic/fnic_scsi.c:98:38: warning: array subscript -1 is outside array bounds of 'struct scsi_cmnd[23529010298098917]'
Date: Wed, 18 Oct 2023 19:21:14 +0800 [thread overview]
Message-ID: <202310181947.fzMfU0gi-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 06dc10eae55b5ceabfef287a7e5f16ceea204aa0
commit: 514f0c400bde6b62405467daaf2a0a86bcf7794b scsi: fnic: Fix sg_reset success path
date: 3 weeks ago
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20231018/202310181947.fzMfU0gi-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231018/202310181947.fzMfU0gi-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202310181947.fzMfU0gi-lkp@intel.com/
All warnings (new ones prefixed by >>):
In function 'fnic_io_lock_hash',
inlined from 'fnic_fcpio_itmf_cmpl_handler' at drivers/scsi/fnic/fnic_scsi.c:1086:13:
>> drivers/scsi/fnic/fnic_scsi.c:98:38: warning: array subscript -1 is outside array bounds of 'struct scsi_cmnd[23529010298098917]' [-Warray-bounds]
98 | u32 hash = scsi_cmd_to_rq(sc)->tag & (FNIC_IO_LOCKS - 1);
| ~~~~~~~~~~~~~~~~~~^~~~~
>> drivers/scsi/fnic/fnic_scsi.c:98:38: warning: array subscript -1 is outside array bounds of 'struct scsi_cmnd[23529010298098917]' [-Warray-bounds]
>> drivers/scsi/fnic/fnic_scsi.c:98:38: warning: array subscript -1 is outside array bounds of 'struct scsi_cmnd[23529010298098917]' [-Warray-bounds]
>> drivers/scsi/fnic/fnic_scsi.c:98:38: warning: array subscript -1 is outside array bounds of 'struct scsi_cmnd[23529010298098917]' [-Warray-bounds]
vim +98 drivers/scsi/fnic/fnic_scsi.c
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 94
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 95 static inline spinlock_t *fnic_io_lock_hash(struct fnic *fnic,
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 96 struct scsi_cmnd *sc)
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 97 {
e1c9f0cfac4f2e Bart Van Assche 2021-08-09 @98 u32 hash = scsi_cmd_to_rq(sc)->tag & (FNIC_IO_LOCKS - 1);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 99
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 100 return &fnic->io_req_lock[hash];
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 101 }
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 102
:::::: The code at line 98 was first introduced by commit
:::::: e1c9f0cfac4f2ed2bc6e89f2f4061dcf1538d4cd scsi: fnic: Use scsi_cmd_to_rq() instead of scsi_cmnd.request
:::::: TO: Bart Van Assche <bvanassche@acm.org>
:::::: CC: Martin K. Petersen <martin.petersen@oracle.com>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2023-10-18 11:21 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=202310181947.fzMfU0gi-lkp@intel.com \
--to=lkp@intel.com \
--cc=arulponn@cisco.com \
--cc=kartilak@cisco.com \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=sebaddel@cisco.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
all inboxes | Powered by JetHome®