Skip to content

Commit

Permalink
cfg80211: amend regulatory NULL dereference fix
Browse files Browse the repository at this point in the history
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: stable@vger.kernel.org
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>
  • Loading branch information
Luis R. Rodriguez authored and John W. Linville committed Nov 30, 2011
1 parent a042994 commit 0bac71a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions net/wireless/reg.c
Original file line number Diff line number Diff line change
Expand Up @@ -2049,8 +2049,10 @@ static int __set_regdom(const struct ieee80211_regdomain *rd)
}

request_wiphy = wiphy_idx_to_wiphy(last_request->wiphy_idx);
if (!request_wiphy) {
reg_set_request_processed();
if (!request_wiphy &&
(last_request->initiator == NL80211_REGDOM_SET_BY_DRIVER ||
last_request->initiator == NL80211_REGDOM_SET_BY_COUNTRY_IE)) {
schedule_delayed_work(&reg_timeout, 0);
return -ENODEV;
}

Expand Down

0 comments on commit 0bac71a

Please sign in to comment.