CC: [email protected]
TO: Leon Romanovsky <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git 
devlink-core
head:   84f6d5ca4cad2a2c56535c3c2c3134785250d975
commit: 18d606dbe872b46d1ff00b8b0b88b29ade128a72 [14/19] devlink: Account 
struct devlink users
:::::: branch date: 5 hours ago
:::::: commit date: 5 hours ago
config: i386-randconfig-c001-20210418 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>
Reported-by: Julia Lawall <[email protected]>


cocci warnings: (new ones prefixed by >>)
>> net/core/devlink.c:152:32-39: ERROR: invalid reference to the index variable 
>> of the iterator on line 143

vim +152 net/core/devlink.c

18d606dbe872b4 Leon Romanovsky 2021-03-07  126  
bfcd3a46617209 Jiri Pirko      2016-02-26  127  static struct devlink 
*devlink_get_from_attrs(struct net *net,
bfcd3a46617209 Jiri Pirko      2016-02-26  128                                  
              struct nlattr **attrs)
bfcd3a46617209 Jiri Pirko      2016-02-26  129  {
bfcd3a46617209 Jiri Pirko      2016-02-26  130          struct devlink *devlink;
18d606dbe872b4 Leon Romanovsky 2021-03-07  131          bool found = false;
bfcd3a46617209 Jiri Pirko      2016-02-26  132          char *busname;
bfcd3a46617209 Jiri Pirko      2016-02-26  133          char *devname;
bfcd3a46617209 Jiri Pirko      2016-02-26  134  
bfcd3a46617209 Jiri Pirko      2016-02-26  135          if 
(!attrs[DEVLINK_ATTR_BUS_NAME] || !attrs[DEVLINK_ATTR_DEV_NAME])
bfcd3a46617209 Jiri Pirko      2016-02-26  136                  return 
ERR_PTR(-EINVAL);
bfcd3a46617209 Jiri Pirko      2016-02-26  137  
bfcd3a46617209 Jiri Pirko      2016-02-26  138          busname = 
nla_data(attrs[DEVLINK_ATTR_BUS_NAME]);
bfcd3a46617209 Jiri Pirko      2016-02-26  139          devname = 
nla_data(attrs[DEVLINK_ATTR_DEV_NAME]);
bfcd3a46617209 Jiri Pirko      2016-02-26  140  
dac7c08f988bbc Parav Pandit    2019-02-12  141          
lockdep_assert_held(&devlink_mutex);
dac7c08f988bbc Parav Pandit    2019-02-12  142  
bfcd3a46617209 Jiri Pirko      2016-02-26 @143          
list_for_each_entry(devlink, &devlink_list, list) {
bfcd3a46617209 Jiri Pirko      2016-02-26  144                  if 
(strcmp(devlink->dev->bus->name, busname) == 0 &&
bfcd3a46617209 Jiri Pirko      2016-02-26  145                      
strcmp(dev_name(devlink->dev), devname) == 0 &&
18d606dbe872b4 Leon Romanovsky 2021-03-07  146                      
net_eq(devlink_net(devlink), net)) {
18d606dbe872b4 Leon Romanovsky 2021-03-07  147                          found = 
true;
18d606dbe872b4 Leon Romanovsky 2021-03-07  148                          break;
18d606dbe872b4 Leon Romanovsky 2021-03-07  149                  }
bfcd3a46617209 Jiri Pirko      2016-02-26  150          }
bfcd3a46617209 Jiri Pirko      2016-02-26  151  
18d606dbe872b4 Leon Romanovsky 2021-03-07 @152          if (!found || 
!devlink_try_get(devlink))
18d606dbe872b4 Leon Romanovsky 2021-03-07  153                  devlink = 
ERR_PTR(-ENODEV);
18d606dbe872b4 Leon Romanovsky 2021-03-07  154  
18d606dbe872b4 Leon Romanovsky 2021-03-07  155          return devlink;
bfcd3a46617209 Jiri Pirko      2016-02-26  156  }
bfcd3a46617209 Jiri Pirko      2016-02-26  157  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

Attachment: .config.gz
Description: application/gzip

_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to