From: Luis R. Rodriguez Date: Mon, 28 Nov 2011 21:47:16 +0000 (-0500) Subject: cfg80211: amend regulatory NULL dereference fix X-Git-Tag: v3.0.13~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7e06614ab127e8c9de4af2e8f9d66953d3e68297;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.git cfg80211: amend regulatory NULL dereference fix 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 Signed-off-by: Luis R. Rodriguez Reviewed-by: Johannes Berg Signed-off-by: John W. Linville Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/wireless/reg.c b/net/wireless/reg.c index 0625ada..ca76d8b 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c @@ -2040,8 +2040,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(®_timeout, 0); return -ENODEV; }