]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
wifi: cfg80211: silence a sparse RCU warning
authorJohannes Berg <johannes.berg@intel.com>
Thu, 13 Oct 2022 17:41:51 +0000 (19:41 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Nov 2022 09:03:50 +0000 (10:03 +0100)
[ Upstream commit 03c0ad4b06c3566de624b4f4b78ac1a5d1e4c8e7 ]

All we're going to do with this pointer is assign it to
another __rcu pointer, but sparse can't see that, so
use rcu_access_pointer() to silence the warning here.

Fixes: c90b93b5b782 ("wifi: cfg80211: update hidden BSSes to avoid WARN_ON")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/wireless/scan.c

index 39fb9cc25cdcae219f132ecb62d3171efb35b430..9067e4b70855ac7a2aaf3112226c53848f1c20bd 100644 (file)
@@ -1674,7 +1674,9 @@ cfg80211_update_known_bss(struct cfg80211_registered_device *rdev,
                if (old == rcu_access_pointer(known->pub.ies))
                        rcu_assign_pointer(known->pub.ies, new->pub.beacon_ies);
 
-               cfg80211_update_hidden_bsses(known, new->pub.beacon_ies, old);
+               cfg80211_update_hidden_bsses(known,
+                                            rcu_access_pointer(new->pub.beacon_ies),
+                                            old);
 
                if (old)
                        kfree_rcu((struct cfg80211_bss_ies *)old, rcu_head);