When joining a new IBSS, all old stations are flushed, but currently
all stations belonging to all virtual interfaces are flushed, which
is wrong. This patch fixes it.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
 
        sband = local->hw.wiphy->bands[local->hw.conf.channel->band];
 
+       sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+
        /* Remove possible STA entries from other IBSS networks. */
-       sta_info_flush(local, NULL);
+       sta_info_flush(local, sdata);
 
        if (local->ops->reset_tsf) {
                /* Reset own TSF to allow time synchronization work. */
 
        local->hw.conf.beacon_int = bss->beacon_int >= 10 ? bss->beacon_int : 10;
 
-       sdata = IEEE80211_DEV_TO_SUB_IF(dev);
        sdata->drop_unencrypted = bss->capability &
                WLAN_CAPABILITY_PRIVACY ? 1 : 0;