From: Johannes Berg Date: Tue, 14 Sep 2010 19:34:14 +0000 (+0200) Subject: mac80211: match only assigned bss in sta_info_get_bss X-Git-Tag: v3.12-rc1~8399^2~265^2^2~115 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a2c1e3dad516618cb0fbfb1a62c36d0b0744573a;p=kernel%2Fkernel-generic.git 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: Ben Greear Signed-off-by: Johannes Berg Signed-off-by: John W. Linville --- diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index 687077e..e356ff8 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c @@ -125,7 +125,7 @@ struct sta_info *sta_info_get_bss(struct ieee80211_sub_if_data *sdata, lockdep_is_held(&local->sta_mtx)); while (sta) { 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) break; sta = rcu_dereference_check(sta->hnext,