aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuis R. Rodriguez <mcgrof@qca.qualcomm.com>2011-11-28 16:47:16 -0500
committerHerton Ronaldo Krzesinski <herton.krzesinski@canonical.com>2011-12-12 08:07:09 -0500
commit33cf3ca3ccd5f4c9a533da10c5f299c33d8727b8 (patch)
tree2d9d00338e3891622366cc44591676164de6c603
parent8c3f149e52ce6867cdfde2685b82130f9d024881 (diff)
cfg80211: amend regulatory NULL dereference fix
BugLink: http://bugs.launchpad.net/bugs/902312 commit 0bac71af6e66dc798bf07d0c0dd14ee5503362f9 upstream. Johannes' patch for "cfg80211: fix regulatory NULL dereference" broke user regulaotry hints and it did not address the fact that last_request was left populated even if the previous regulatory hint was stale due to the wiphy disappearing. Fix user reguluatory hints by only bailing out if for those regulatory hints where a request_wiphy is expected. The stale last_request considerations are addressed through the previous fixes on last_request where we reset the last_request to a static world regdom request upon reset_regdomains(). In this case though we further enhance the effect by simply restoring reguluatory settings completely. Cc: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com> Reviewed-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
-rw-r--r--net/wireless/reg.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 0625adade96..ca76d8b55c4 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -2040,8 +2040,10 @@ static int __set_regdom(const struct ieee80211_regdomain *rd)
2040 } 2040 }
2041 2041
2042 request_wiphy = wiphy_idx_to_wiphy(last_request->wiphy_idx); 2042 request_wiphy = wiphy_idx_to_wiphy(last_request->wiphy_idx);
2043 if (!request_wiphy) { 2043 if (!request_wiphy &&
2044 reg_set_request_processed(); 2044 (last_request->initiator == NL80211_REGDOM_SET_BY_DRIVER ||
2045 last_request->initiator == NL80211_REGDOM_SET_BY_COUNTRY_IE)) {
2046 schedule_delayed_work(&reg_timeout, 0);
2045 return -ENODEV; 2047 return -ENODEV;
2046 } 2048 }
2047 2049