Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* Re: [PATCH wireless-next 03/18] wifi: nl80211: avoid rtnl for commands that don't want it
       [not found] <20261004210122.3b67fb1a6a69.I9c4f85fb60160f377a24c1b8e5173966744e5f09@changeid>
@ 2026-10-05  4:18 ` kernel test robot
  2026-10-05  5:28   ` Johannes Berg
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2026-10-05  4:18 UTC (permalink / raw)
  To: Johannes Berg, linux-wireless; +Cc: llvm, oe-kbuild-all, Johannes Berg

Hi Johannes,

kernel test robot noticed the following build warnings:

[auto build test WARNING on wireless-next/main]

url:    https://github.com/intel-lab-lkp/linux/commits/Johannes-Berg/wifi-cfg80211-track-netdev-running-state-under-wiphy-mutex/20261004-210115
base:   https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next.git main
patch link:    https://lore.kernel.org/r/20261004210122.3b67fb1a6a69.I9c4f85fb60160f377a24c1b8e5173966744e5f09%40changeid
patch subject: [PATCH wireless-next 03/18] wifi: nl80211: avoid rtnl for commands that don't want it
config: loongarch-defconfig (https://download.01.org/0day-ci/archive/20261005/202610051243.rHmDLV0g-lkp@intel.com/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project 5f609f950d2e80addf5566623013db68394334db)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261005/202610051243.rHmDLV0g-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202610051243.rHmDLV0g-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> net/wireless/nl80211.c:244:7: warning: variable 'wdev' is uninitialized when used here [-Wuninitialized]
     244 |             (wdev->netdev && !net_eq(dev_net(wdev->netdev), netns))) {
         |              ^~~~
   net/wireless/nl80211.c:238:27: note: initialize the variable 'wdev' to silence this warning
     238 |         struct wireless_dev *wdev;
         |                                  ^
         |                                   = NULL
   1 warning generated.


vim +/wdev +244 net/wireless/nl80211.c

   227	
   228	/*
   229	 * Lock the given wiphy, put the device and double-check it's
   230	 * still valid to use.
   231	 *
   232	 * Returns with wiphy mutex held unless there was an error.
   233	 */
   234	static struct wireless_dev *
   235	nl80211_lock_and_recheck(struct cfg80211_registered_device *rdev,
   236				 struct net *netns, u32 wdev_id)
   237	{
   238		struct wireless_dev *wdev;
   239	
   240		wiphy_lock(&rdev->wiphy);
   241	
   242		if (!rdev->wiphy.registered ||
   243		    !net_eq(wiphy_net(&rdev->wiphy), netns) ||
 > 244		    (wdev->netdev && !net_eq(dev_net(wdev->netdev), netns))) {
   245			wiphy_unlock(&rdev->wiphy);
   246			put_device(&rdev->wiphy.dev);
   247			return ERR_PTR(-ENODEV);
   248		}
   249	
   250		/*
   251		 * unregistration blocks on wiphy mutex,
   252		 * so we don't need this now
   253		 */
   254		put_device(&rdev->wiphy.dev);
   255	
   256		if (!wdev_id)
   257			return NULL;
   258	
   259		list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) {
   260			if (wdev->identifier == wdev_id)
   261				return wdev;
   262		}
   263		wiphy_unlock(&rdev->wiphy);
   264	
   265		return ERR_PTR(-ENODEV);
   266	}
   267	

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH wireless-next 03/18] wifi: nl80211: avoid rtnl for commands that don't want it
  2026-10-05  4:18 ` [PATCH wireless-next 03/18] wifi: nl80211: avoid rtnl for commands that don't want it kernel test robot
@ 2026-10-05  5:28   ` Johannes Berg
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2026-10-05  5:28 UTC (permalink / raw)
  To: kernel test robot, linux-wireless; +Cc: llvm, oe-kbuild-all

On Mon, 2026-10-05 at 12:18 +0800, kernel test robot wrote:
> 
> > > net/wireless/nl80211.c:244:7: warning: variable 'wdev' is uninitialized when used here [-Wuninitialized]
>      244 |             (wdev->netdev && !net_eq(dev_net(wdev->netdev), netns))) {
>          |              ^~~~

Yes ... noticed that too, just slightly too late.

>    net/wireless/nl80211.c:238:27: note: initialize the variable 'wdev' to silence this warning
>      238 |         struct wireless_dev *wdev;
>          |                                  ^
>          |                                   = NULL

That'd be pointless.

>  > 244		    (wdev->netdev && !net_eq(dev_net(wdev->netdev), netns))) {

that line

>    245			wiphy_unlock(&rdev->wiphy);
>    246			put_device(&rdev->wiphy.dev);
>    247			return ERR_PTR(-ENODEV);
>    248		}
>    249	
>    250		/*
>    251		 * unregistration blocks on wiphy mutex,
>    252		 * so we don't need this now
>    253		 */
>    254		put_device(&rdev->wiphy.dev);
>    255	
>    256		if (!wdev_id)
>    257			return NULL;
>    258	
>    259		list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) {
>    260			if (wdev->identifier == wdev_id)
>    261				return wdev;

needs to move here.

johannes

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-05  5:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20261004210122.3b67fb1a6a69.I9c4f85fb60160f377a24c1b8e5173966744e5f09@changeid>
2026-10-05  4:18 ` [PATCH wireless-next 03/18] wifi: nl80211: avoid rtnl for commands that don't want it kernel test robot
2026-10-05  5:28   ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox