* [pkshih-rtw:rtw-next 22/40] net/wireless/nl80211.c:267 nl80211_lock_and_recheck() warn: inconsistent returns '&rdev->wiphy.mtx'.
@ 2026-10-11 8:15 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-10-11 8:15 UTC (permalink / raw)
To: oe-kbuild; +Cc: lkp, Dan Carpenter
Unfiltered warning: this smatch report is sent as-is and has not been
reviewed for false positives, so please treat it with due skepticism.
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: Johannes Berg <johannes.berg@intel.com>
tree: https://github.com/pkshih/rtw rtw-next
head: fbfa27d9b06f025c5f2cfa79d0e01e6400eeff2a
commit: 8e3d9039d280c61e1ef5c5cbe8ee8db342907173 [22/40] wifi: nl80211: avoid rtnl for commands that don't want it
:::::: branch date: 25 hours ago
:::::: commit date: 2 days ago
config: x86_64-randconfig-r2202-20261011 (https://download.01.org/0day-ci/archive/20261011/202610111016.9wexeSaG-lkp@intel.com/config)
compiler: clang version 22.1.8 (https://github.com/llvm/llvm-project ca7933e47d3a3451d81e72ac174dcb5aa28b59d1)
smatch: v0.5.0-9187-g5189e3fb
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>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202610111016.9wexeSaG-lkp@intel.com/
New smatch warnings:
net/wireless/nl80211.c:267 nl80211_lock_and_recheck() warn: inconsistent returns '&rdev->wiphy.mtx'.
Old smatch warnings:
net/wireless/nl80211.c:4843 nl80211_send_iface() error: we previously assumed 'rdev->ops->get_channel' could be null (see line 4766)
vim +267 net/wireless/nl80211.c
a9455408b09395 Johannes Berg 2012-06-15 227
8e3d9039d280c6 Johannes Berg 2026-10-06 228 /*
8e3d9039d280c6 Johannes Berg 2026-10-06 229 * Lock the given wiphy, put the device and double-check it's
8e3d9039d280c6 Johannes Berg 2026-10-06 230 * still valid to use.
8e3d9039d280c6 Johannes Berg 2026-10-06 231 *
8e3d9039d280c6 Johannes Berg 2026-10-06 232 * Returns with wiphy mutex held unless there was an error.
8e3d9039d280c6 Johannes Berg 2026-10-06 233 */
8e3d9039d280c6 Johannes Berg 2026-10-06 234 static struct wireless_dev *
8e3d9039d280c6 Johannes Berg 2026-10-06 235 nl80211_lock_and_recheck(struct cfg80211_registered_device *rdev,
8e3d9039d280c6 Johannes Berg 2026-10-06 236 struct net *netns, u32 wdev_id)
8e3d9039d280c6 Johannes Berg 2026-10-06 237 {
8e3d9039d280c6 Johannes Berg 2026-10-06 238 struct wireless_dev *wdev;
8e3d9039d280c6 Johannes Berg 2026-10-06 239
8e3d9039d280c6 Johannes Berg 2026-10-06 240 wiphy_lock(&rdev->wiphy);
8e3d9039d280c6 Johannes Berg 2026-10-06 241
8e3d9039d280c6 Johannes Berg 2026-10-06 242 if (!rdev->wiphy.registered ||
8e3d9039d280c6 Johannes Berg 2026-10-06 243 !net_eq(wiphy_net(&rdev->wiphy), netns)) {
8e3d9039d280c6 Johannes Berg 2026-10-06 244 wiphy_unlock(&rdev->wiphy);
8e3d9039d280c6 Johannes Berg 2026-10-06 245 put_device(&rdev->wiphy.dev);
8e3d9039d280c6 Johannes Berg 2026-10-06 246 return ERR_PTR(-ENODEV);
8e3d9039d280c6 Johannes Berg 2026-10-06 247 }
8e3d9039d280c6 Johannes Berg 2026-10-06 248
8e3d9039d280c6 Johannes Berg 2026-10-06 249 /*
8e3d9039d280c6 Johannes Berg 2026-10-06 250 * unregistration blocks on wiphy mutex,
8e3d9039d280c6 Johannes Berg 2026-10-06 251 * so we don't need this now
8e3d9039d280c6 Johannes Berg 2026-10-06 252 */
8e3d9039d280c6 Johannes Berg 2026-10-06 253 put_device(&rdev->wiphy.dev);
8e3d9039d280c6 Johannes Berg 2026-10-06 254
8e3d9039d280c6 Johannes Berg 2026-10-06 255 if (!wdev_id)
8e3d9039d280c6 Johannes Berg 2026-10-06 256 return NULL;
8e3d9039d280c6 Johannes Berg 2026-10-06 257
8e3d9039d280c6 Johannes Berg 2026-10-06 258 list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) {
8e3d9039d280c6 Johannes Berg 2026-10-06 259 if (wdev->identifier != wdev_id)
8e3d9039d280c6 Johannes Berg 2026-10-06 260 continue;
8e3d9039d280c6 Johannes Berg 2026-10-06 261 if (wdev->netdev && !net_eq(dev_net(wdev->netdev), netns))
8e3d9039d280c6 Johannes Berg 2026-10-06 262 break;
8e3d9039d280c6 Johannes Berg 2026-10-06 263 return wdev;
8e3d9039d280c6 Johannes Berg 2026-10-06 264 }
8e3d9039d280c6 Johannes Berg 2026-10-06 265 wiphy_unlock(&rdev->wiphy);
8e3d9039d280c6 Johannes Berg 2026-10-06 266
8e3d9039d280c6 Johannes Berg 2026-10-06 @267 return ERR_PTR(-ENODEV);
8e3d9039d280c6 Johannes Berg 2026-10-06 268 }
8e3d9039d280c6 Johannes Berg 2026-10-06 269
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-11 8:16 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-11 8:15 [pkshih-rtw:rtw-next 22/40] net/wireless/nl80211.c:267 nl80211_lock_and_recheck() warn: inconsistent returns '&rdev->wiphy.mtx' kernel test robot
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.