All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: drivers/media/platform/imx-jpeg/mxc-jpeg.c:455:18: warning: Array index 'free_slot' is used before limits check. [arrayIndexThenCheck]
Date: Tue, 25 Jan 2022 08:26:39 +0800	[thread overview]
Message-ID: <202201250819.NdeqEx1I-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1978 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Mirela Rabulea <mirela.rabulea@nxp.com>
CC: Mauro Carvalho Chehab <mchehab@kernel.org>
CC: linux-media(a)vger.kernel.org
CC: Hans Verkuil <hverkuil@xs4all.nl>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   dd81e1c7d5fb126e5fbc5c9e334d7b3ec29a16a0
commit: 2db16c6ed72ce644d5639b3ed15e5817442db4ba media: imx-jpeg: Add V4L2 driver for i.MX8 JPEG Encoder/Decoder
date:   10 months ago
:::::: branch date: 32 hours ago
:::::: commit date: 10 months ago
compiler: sparc-linux-gcc (GCC) 11.2.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


cppcheck possible warnings: (new ones prefixed by >>, may not real problems)

>> drivers/media/platform/imx-jpeg/mxc-jpeg.c:455:18: warning: Array index 'free_slot' is used before limits check. [arrayIndexThenCheck]
    while (slot_data[free_slot].used && free_slot < n)
                    ^

vim +/free_slot +455 drivers/media/platform/imx-jpeg/mxc-jpeg.c

2db16c6ed72ce6 Mirela Rabulea 2021-03-11  450  
2db16c6ed72ce6 Mirela Rabulea 2021-03-11  451  static int mxc_get_free_slot(struct mxc_jpeg_slot_data slot_data[], int n)
2db16c6ed72ce6 Mirela Rabulea 2021-03-11  452  {
2db16c6ed72ce6 Mirela Rabulea 2021-03-11  453  	int free_slot = 0;
2db16c6ed72ce6 Mirela Rabulea 2021-03-11  454  
2db16c6ed72ce6 Mirela Rabulea 2021-03-11 @455  	while (slot_data[free_slot].used && free_slot < n)
2db16c6ed72ce6 Mirela Rabulea 2021-03-11  456  		free_slot++;
2db16c6ed72ce6 Mirela Rabulea 2021-03-11  457  
2db16c6ed72ce6 Mirela Rabulea 2021-03-11  458  	return free_slot; /* >=n when there are no more free slots */
2db16c6ed72ce6 Mirela Rabulea 2021-03-11  459  }
2db16c6ed72ce6 Mirela Rabulea 2021-03-11  460  

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

                 reply	other threads:[~2022-01-25  0:26 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=202201250819.NdeqEx1I-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild@lists.01.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.