From: Johannes Berg Date: Sat, 25 Feb 2012 20:40:46 +0000 (+0100) Subject: mac80211: fix sta_info_flush() return value X-Git-Tag: firefly_0821_release~3680^2~3338^2~108^2~249 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=3431683759596409427b6726e582f3ee66082728;p=firefly-linux-kernel-4.4.55.git mac80211: fix sta_info_flush() return value The comment for sta_info_flush() states "Returns the number of removed STA entries" but that isn't actually true. Consequently, the warning when a station is still around on interface removal can never trigger and this delayed finding the timer issue the previous patch fixed. Fix the return value here to make that warning useful again. 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 4034ee616022..98613c8f08cf 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c @@ -865,8 +865,10 @@ int sta_info_flush(struct ieee80211_local *local, mutex_lock(&local->sta_mtx); list_for_each_entry_safe(sta, tmp, &local->sta_list, list) { - if (!sdata || sdata == sta->sdata) + if (!sdata || sdata == sta->sdata) { WARN_ON(__sta_info_destroy(sta)); + ret++; + } } mutex_unlock(&local->sta_mtx);