]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
wifi: mac80211: Fix sparse warning for monitor_sdata
authorAlexander Wetzel <Alexander@wetzel-home.de>
Thu, 13 Feb 2025 21:43:30 +0000 (22:43 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Apr 2025 12:39:36 +0000 (14:39 +0200)
commit 861d0445e72e9e33797f2ceef882c74decb16a87 upstream.

Use rcu_access_pointer() to avoid sparse warning in
drv_remove_interface().

Signed-off-by: Alexander Wetzel <Alexander@wetzel-home.de>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202502130534.bVrZZBK0-lkp@intel.com/
Fixes: 646262c71aca ("wifi: mac80211: remove debugfs dir for virtual monitor")
Link: https://patch.msgid.link/20250213214330.6113-1-Alexander@wetzel-home.de
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/mac80211/driver-ops.c

index 9b7d099948207dcc7fda7700c1f00625bd31e96e..4243f8ee5ab6b63d25d50efb7409a2432e47c541 100644 (file)
@@ -120,7 +120,7 @@ void drv_remove_interface(struct ieee80211_local *local,
         * The virtual monitor interface doesn't get a debugfs
         * entry, so it's exempt here.
         */
-       if (sdata != local->monitor_sdata)
+       if (sdata != rcu_access_pointer(local->monitor_sdata))
                ieee80211_debugfs_recreate_netdev(sdata,
                                                  sdata->vif.valid_links);