aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-04-15 15:33:15 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-04-17 15:27:13 -0400
commit7181d4673710888b6d7084b37b9d77ed4f4e41b2 (patch)
treeba8c94b02cf57d01256d95f28f3f4fd628cf4c53 /net/mac80211
parent1269fa737f21b3f643e4b12d3ac9938b142a7f00 (diff)
mac80211: avoid crashing when no scan sdata
Using the scan_sdata variable here is terribly wrong, if there has never been a scan then we fail. However, we need a bandaid... Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Cc: stable@kernel.org [2.6.29] Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/mlme.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 1b14d0204dd2..dc60804d6dd0 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -2113,12 +2113,13 @@ void ieee80211_dynamic_ps_enable_work(struct work_struct *work)
2113 struct ieee80211_local *local = 2113 struct ieee80211_local *local =
2114 container_of(work, struct ieee80211_local, 2114 container_of(work, struct ieee80211_local,
2115 dynamic_ps_enable_work); 2115 dynamic_ps_enable_work);
2116 /* XXX: using scan_sdata is completely broken! */
2116 struct ieee80211_sub_if_data *sdata = local->scan_sdata; 2117 struct ieee80211_sub_if_data *sdata = local->scan_sdata;
2117 2118
2118 if (local->hw.conf.flags & IEEE80211_CONF_PS) 2119 if (local->hw.conf.flags & IEEE80211_CONF_PS)
2119 return; 2120 return;
2120 2121
2121 if (local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK) 2122 if (local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK && sdata)
2122 ieee80211_send_nullfunc(local, sdata, 1); 2123 ieee80211_send_nullfunc(local, sdata, 1);
2123 2124
2124 local->hw.conf.flags |= IEEE80211_CONF_PS; 2125 local->hw.conf.flags |= IEEE80211_CONF_PS;