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

Commit a2c1e3da authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville
Browse files

mac80211: match only assigned bss in sta_info_get_bss



sta_info_get_bss() is used to match STA pointers
for VLAN/AP interfaces, but if the same station
is also added to multiple other interfaces it
will erroneously match because both pointers are
NULL, fix this by ignoring NULL pointers here.

Reported-by: default avatarBen Greear <greearb@candelatech.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 364734fa
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -125,7 +125,7 @@ struct sta_info *sta_info_get_bss(struct ieee80211_sub_if_data *sdata,
				    lockdep_is_held(&local->sta_mtx));
				    lockdep_is_held(&local->sta_mtx));
	while (sta) {
	while (sta) {
		if ((sta->sdata == sdata ||
		if ((sta->sdata == sdata ||
		     sta->sdata->bss == sdata->bss) &&
		     (sta->sdata->bss && sta->sdata->bss == sdata->bss)) &&
		    memcmp(sta->sta.addr, addr, ETH_ALEN) == 0)
		    memcmp(sta->sta.addr, addr, ETH_ALEN) == 0)
			break;
			break;
		sta = rcu_dereference_check(sta->hnext,
		sta = rcu_dereference_check(sta->hnext,