All of lore.kernel.org
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Oleksandr Natalenko <oleksandr@redhat.com>
Cc: kbuild-all@lists.01.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Linux Memory Management List <linux-mm@kvack.org>
Subject: [linux-next:master 5090/5337] drivers//base/devcon.c:180:9: warning: array subscript is below array bounds
Date: Thu, 26 Dec 2019 14:22:18 +0800	[thread overview]
Message-ID: <201912261407.qh2h8Hy8%lkp@intel.com> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   7ddd09fc4b745fb1d8942f95389583e08412e0cd
commit: 27fc2e84ab6df89e3c8f333701055af6704634c5 [5090/5337] init/Kconfig: enable -O3 for all arches
config: i386-randconfig-f001-20191226 (attached as .config)
compiler: gcc-7 (Debian 7.5.0-3) 7.5.0
reproduce:
        git checkout 27fc2e84ab6df89e3c8f333701055af6704634c5
        # save the attached .config to linux build tree
        make ARCH=i386 

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

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.

All warnings (new ones prefixed by >>):

   drivers//base/devcon.c: In function 'device_connection_find':
>> drivers//base/devcon.c:180:9: warning: array subscript is below array bounds [-Warray-bounds]
      dev = bus_find_device_by_name(bus, NULL, con->endpoint[ep]);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers//base/devcon.c:180:9: warning: array subscript is below array bounds [-Warray-bounds]
      dev = bus_find_device_by_name(bus, NULL, con->endpoint[ep]);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

vim +180 drivers//base/devcon.c

80e04837a40f6f Heikki Krogerus 2019-02-13  169  
f2d9b66d84f3ff Heikki Krogerus 2018-03-20  170  /* This tries to find the device from the most common bus types by name. */
f2d9b66d84f3ff Heikki Krogerus 2018-03-20  171  static void *generic_match(struct device_connection *con, int ep, void *data)
f2d9b66d84f3ff Heikki Krogerus 2018-03-20  172  {
f2d9b66d84f3ff Heikki Krogerus 2018-03-20  173  	struct bus_type *bus;
f2d9b66d84f3ff Heikki Krogerus 2018-03-20  174  	struct device *dev;
f2d9b66d84f3ff Heikki Krogerus 2018-03-20  175  
80e04837a40f6f Heikki Krogerus 2019-02-13  176  	if (con->fwnode)
80e04837a40f6f Heikki Krogerus 2019-02-13  177  		return device_connection_fwnode_match(con);
80e04837a40f6f Heikki Krogerus 2019-02-13  178  
f2d9b66d84f3ff Heikki Krogerus 2018-03-20  179  	for (bus = generic_match_buses[0]; bus; bus++) {
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 @180  		dev = bus_find_device_by_name(bus, NULL, con->endpoint[ep]);
f2d9b66d84f3ff Heikki Krogerus 2018-03-20  181  		if (dev)
f2d9b66d84f3ff Heikki Krogerus 2018-03-20  182  			return dev;
f2d9b66d84f3ff Heikki Krogerus 2018-03-20  183  	}
f2d9b66d84f3ff Heikki Krogerus 2018-03-20  184  
f2d9b66d84f3ff Heikki Krogerus 2018-03-20  185  	/*
f2d9b66d84f3ff Heikki Krogerus 2018-03-20  186  	 * We only get called if a connection was found, tell the caller to
f2d9b66d84f3ff Heikki Krogerus 2018-03-20  187  	 * wait for the other device to show up.
f2d9b66d84f3ff Heikki Krogerus 2018-03-20  188  	 */
f2d9b66d84f3ff Heikki Krogerus 2018-03-20  189  	return ERR_PTR(-EPROBE_DEFER);
f2d9b66d84f3ff Heikki Krogerus 2018-03-20  190  }
f2d9b66d84f3ff Heikki Krogerus 2018-03-20  191  

:::::: The code at line 180 was first introduced by commit
:::::: f2d9b66d84f3ff5ea3aff111e6a403e04fa8bf37 drivers: base: Unified device connection lookup

:::::: TO: Heikki Krogerus <heikki.krogerus@linux.intel.com>
:::::: CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
0-DAY kernel test infrastructure                 Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 34960 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: kbuild test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [linux-next:master 5090/5337] drivers//base/devcon.c:180:9: warning: array subscript is below array bounds
Date: Thu, 26 Dec 2019 14:22:18 +0800	[thread overview]
Message-ID: <201912261407.qh2h8Hy8%lkp@intel.com> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   7ddd09fc4b745fb1d8942f95389583e08412e0cd
commit: 27fc2e84ab6df89e3c8f333701055af6704634c5 [5090/5337] init/Kconfig: enable -O3 for all arches
config: i386-randconfig-f001-20191226 (attached as .config)
compiler: gcc-7 (Debian 7.5.0-3) 7.5.0
reproduce:
        git checkout 27fc2e84ab6df89e3c8f333701055af6704634c5
        # save the attached .config to linux build tree
        make ARCH=i386 

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

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.

All warnings (new ones prefixed by >>):

   drivers//base/devcon.c: In function 'device_connection_find':
>> drivers//base/devcon.c:180:9: warning: array subscript is below array bounds [-Warray-bounds]
      dev = bus_find_device_by_name(bus, NULL, con->endpoint[ep]);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers//base/devcon.c:180:9: warning: array subscript is below array bounds [-Warray-bounds]
      dev = bus_find_device_by_name(bus, NULL, con->endpoint[ep]);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

vim +180 drivers//base/devcon.c

80e04837a40f6f Heikki Krogerus 2019-02-13  169  
f2d9b66d84f3ff Heikki Krogerus 2018-03-20  170  /* This tries to find the device from the most common bus types by name. */
f2d9b66d84f3ff Heikki Krogerus 2018-03-20  171  static void *generic_match(struct device_connection *con, int ep, void *data)
f2d9b66d84f3ff Heikki Krogerus 2018-03-20  172  {
f2d9b66d84f3ff Heikki Krogerus 2018-03-20  173  	struct bus_type *bus;
f2d9b66d84f3ff Heikki Krogerus 2018-03-20  174  	struct device *dev;
f2d9b66d84f3ff Heikki Krogerus 2018-03-20  175  
80e04837a40f6f Heikki Krogerus 2019-02-13  176  	if (con->fwnode)
80e04837a40f6f Heikki Krogerus 2019-02-13  177  		return device_connection_fwnode_match(con);
80e04837a40f6f Heikki Krogerus 2019-02-13  178  
f2d9b66d84f3ff Heikki Krogerus 2018-03-20  179  	for (bus = generic_match_buses[0]; bus; bus++) {
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 @180  		dev = bus_find_device_by_name(bus, NULL, con->endpoint[ep]);
f2d9b66d84f3ff Heikki Krogerus 2018-03-20  181  		if (dev)
f2d9b66d84f3ff Heikki Krogerus 2018-03-20  182  			return dev;
f2d9b66d84f3ff Heikki Krogerus 2018-03-20  183  	}
f2d9b66d84f3ff Heikki Krogerus 2018-03-20  184  
f2d9b66d84f3ff Heikki Krogerus 2018-03-20  185  	/*
f2d9b66d84f3ff Heikki Krogerus 2018-03-20  186  	 * We only get called if a connection was found, tell the caller to
f2d9b66d84f3ff Heikki Krogerus 2018-03-20  187  	 * wait for the other device to show up.
f2d9b66d84f3ff Heikki Krogerus 2018-03-20  188  	 */
f2d9b66d84f3ff Heikki Krogerus 2018-03-20  189  	return ERR_PTR(-EPROBE_DEFER);
f2d9b66d84f3ff Heikki Krogerus 2018-03-20  190  }
f2d9b66d84f3ff Heikki Krogerus 2018-03-20  191  

:::::: The code at line 180 was first introduced by commit
:::::: f2d9b66d84f3ff5ea3aff111e6a403e04fa8bf37 drivers: base: Unified device connection lookup

:::::: TO: Heikki Krogerus <heikki.krogerus@linux.intel.com>
:::::: CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
0-DAY kernel test infrastructure                 Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org Intel Corporation

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 34960 bytes --]

             reply	other threads:[~2019-12-26  6:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-26  6:22 kbuild test robot [this message]
2019-12-26  6:22 ` [linux-next:master 5090/5337] drivers//base/devcon.c:180:9: warning: array subscript is below array bounds kbuild test robot

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=201912261407.qh2h8Hy8%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-mm@kvack.org \
    --cc=oleksandr@redhat.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 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.