linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [kbuild] [mac80211-next:rtnl 22/22] net/wireless/core.c:1336 cfg80211_register_netdevice() error: uninitialized symbol 'rdev'.
@ 2021-01-25 11:01 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2021-01-25 11:01 UTC (permalink / raw)
  To: kbuild, Johannes Berg; +Cc: lkp, kbuild-all, linux-wireless

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git  rtnl
head:   81df9f5e047aa0424b954a726c3fc3259be26526
commit: 81df9f5e047aa0424b954a726c3fc3259be26526 [22/22] cfg80211: avoid holding the RTNL when calling the driver
config: x86_64-randconfig-m001-20210125 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-20) 9.3.0

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

smatch warnings:
net/wireless/core.c:1336 cfg80211_register_netdevice() error: uninitialized symbol 'rdev'.

vim +/rdev +1336 net/wireless/core.c

cf2f4b65e4e9d866 Johannes Berg 2021-01-22  1329  int cfg80211_register_netdevice(struct net_device *dev)
cf2f4b65e4e9d866 Johannes Berg 2021-01-22  1330  {
cf2f4b65e4e9d866 Johannes Berg 2021-01-22  1331  	struct wireless_dev *wdev = dev->ieee80211_ptr;
cf2f4b65e4e9d866 Johannes Berg 2021-01-22  1332  	struct cfg80211_registered_device *rdev;
cf2f4b65e4e9d866 Johannes Berg 2021-01-22  1333  	int ret;
cf2f4b65e4e9d866 Johannes Berg 2021-01-22  1334  
cf2f4b65e4e9d866 Johannes Berg 2021-01-22  1335  	ASSERT_RTNL();
81df9f5e047aa042 Johannes Berg 2021-01-19 @1336  	lockdep_assert_held(&rdev->wiphy.mtx);
                                                                            ^^^^^^^^^^^^^^^^
Uninitialized

cf2f4b65e4e9d866 Johannes Berg 2021-01-22  1337  
cf2f4b65e4e9d866 Johannes Berg 2021-01-22  1338  	if (WARN_ON(!wdev))
cf2f4b65e4e9d866 Johannes Berg 2021-01-22  1339  		return -EINVAL;
cf2f4b65e4e9d866 Johannes Berg 2021-01-22  1340  
cf2f4b65e4e9d866 Johannes Berg 2021-01-22  1341  	rdev = wiphy_to_rdev(wdev->wiphy);
                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

cf2f4b65e4e9d866 Johannes Berg 2021-01-22  1342  
cf2f4b65e4e9d866 Johannes Berg 2021-01-22  1343  	lockdep_assert_held(&rdev->wiphy.mtx);
cf2f4b65e4e9d866 Johannes Berg 2021-01-22  1344  
cf2f4b65e4e9d866 Johannes Berg 2021-01-22  1345  	/* we'll take care of this */
cf2f4b65e4e9d866 Johannes Berg 2021-01-22  1346  	wdev->registered = true;
cf2f4b65e4e9d866 Johannes Berg 2021-01-22  1347  	ret = register_netdevice(dev);
cf2f4b65e4e9d866 Johannes Berg 2021-01-22  1348  	if (ret)
cf2f4b65e4e9d866 Johannes Berg 2021-01-22  1349  		goto out;
cf2f4b65e4e9d866 Johannes Berg 2021-01-22  1350  
cf2f4b65e4e9d866 Johannes Berg 2021-01-22  1351  	if (sysfs_create_link(&dev->dev.kobj, &rdev->wiphy.dev.kobj,
cf2f4b65e4e9d866 Johannes Berg 2021-01-22  1352  			      "phy80211")) {
cf2f4b65e4e9d866 Johannes Berg 2021-01-22  1353  		pr_err("failed to add phy80211 symlink to netdev!\n");
cf2f4b65e4e9d866 Johannes Berg 2021-01-22  1354  		unregister_netdevice(dev);
cf2f4b65e4e9d866 Johannes Berg 2021-01-22  1355  		ret = -EINVAL;
cf2f4b65e4e9d866 Johannes Berg 2021-01-22  1356  		goto out;
cf2f4b65e4e9d866 Johannes Berg 2021-01-22  1357  	}
cf2f4b65e4e9d866 Johannes Berg 2021-01-22  1358  
cf2f4b65e4e9d866 Johannes Berg 2021-01-22  1359  	cfg80211_register_wdev(rdev, wdev);
cf2f4b65e4e9d866 Johannes Berg 2021-01-22  1360  	ret = 0;
cf2f4b65e4e9d866 Johannes Berg 2021-01-22  1361  out:
cf2f4b65e4e9d866 Johannes Berg 2021-01-22  1362  	if (ret)
cf2f4b65e4e9d866 Johannes Berg 2021-01-22  1363  		wdev->registered = false;
cf2f4b65e4e9d866 Johannes Berg 2021-01-22  1364  	return ret;
cf2f4b65e4e9d866 Johannes Berg 2021-01-22  1365  }

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

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

[-- Attachment #3: Type: text/plain, Size: 149 bytes --]

_______________________________________________
kbuild mailing list -- kbuild@lists.01.org
To unsubscribe send an email to kbuild-leave@lists.01.org

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-01-25 11:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-25 11:01 [kbuild] [mac80211-next:rtnl 22/22] net/wireless/core.c:1336 cfg80211_register_netdevice() error: uninitialized symbol 'rdev' Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).