summaryrefslogtreecommitdiffstats
path: root/net/mac80211/sta_info.c
diff options
context:
space:
mode:
authorLuis Carlos Cobo2008-03-01 02:51:25 +0100
committerJohn W. Linville2008-03-06 22:40:54 +0100
commit2a8ca29a88e3858685c463ffd19e11c20d14c73a (patch)
tree78a3cd986d5b136d721b88ef7ee3c1c41374e887 /net/mac80211/sta_info.c
parentmac80211: path IE fields macros, fix alignment problems and clean up (diff)
downloadkernel-qcow2-linux-2a8ca29a88e3858685c463ffd19e11c20d14c73a.tar.gz
kernel-qcow2-linux-2a8ca29a88e3858685c463ffd19e11c20d14c73a.tar.xz
kernel-qcow2-linux-2a8ca29a88e3858685c463ffd19e11c20d14c73a.zip
mac80211: fix mesh_path and sta_info get_by_idx functions
Skip properly entries whose dev does not match. Signed-off-by: Luis Carlos Cobo <luisca@cozybit.com> Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/sta_info.c')
-rw-r--r--net/mac80211/sta_info.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index e27f896dae53..3b84c16cf054 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -115,12 +115,13 @@ struct sta_info *sta_info_get_by_idx(struct ieee80211_local *local, int idx,
int i = 0;
list_for_each_entry_rcu(sta, &local->sta_list, list) {
+ if (dev && dev != sta->sdata->dev)
+ continue;
if (i < idx) {
++i;
continue;
- } else if (!dev || dev == sta->sdata->dev) {
- return sta;
}
+ return sta;
}
return NULL;