Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 52240224 authored by Benjamin Berg's avatar Benjamin Berg Committed by Greg Kroah-Hartman
Browse files

wifi: cfg80211: free beacon_ies when overridden from hidden BSS



[ Upstream commit 32af9a9e1069e55bc02741fb00ac9d0ca1a2eaef ]

This is a more of a cosmetic fix. The branch will only be taken if
proberesp_ies is set, which implies that beacon_ies is not set unless we
are connected to an AP that just did a channel switch. And, in that case
we should have found the BSS in the internal storage to begin with.

Signed-off-by: default avatarBenjamin Berg <benjamin.berg@intel.com>
Reviewed-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarMiri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20231220133549.b898e22dadff.Id8c4c10aedd176ef2e18a4cad747b299f150f9df@changeid


Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 18c2989c
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -1294,8 +1294,12 @@ cfg80211_bss_update(struct cfg80211_registered_device *rdev,
				list_add(&new->hidden_list,
				list_add(&new->hidden_list,
					 &hidden->hidden_list);
					 &hidden->hidden_list);
				hidden->refcount++;
				hidden->refcount++;

				ies = (void *)rcu_dereference(new->pub.beacon_ies);
				rcu_assign_pointer(new->pub.beacon_ies,
				rcu_assign_pointer(new->pub.beacon_ies,
						   hidden->pub.beacon_ies);
						   hidden->pub.beacon_ies);
				if (ies)
					kfree_rcu(ies, rcu_head);
			}
			}
		} else {
		} else {
			/*
			/*