[linux-next:master 5090/5337] drivers//base/devcon.c:180:9: warning: array subscript is below array bounds

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>

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@xxxxxxxxxxxxxxx>
:::::: CC: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

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

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux