Commit 8848bef0 authored by Luis R. Rodriguez's avatar Luis R. Rodriguez Committed by John W. Linville

cfg80211: replace reg.c Nokia commit c4c32294

Nokia hasn't gotten back to me in over 1 month for a relicense
change request. There are only a few changes that they contributed,
so just reverting their changes but replacing with another set.
This change replaces this commit:

commit c4c32294
Author: Yuri Ershov <ext-yuri.ershov@nokia.com>
Date:   Tue Jun 29 15:08:08 2010 +0400

    cfg80211: Update of regulatory request initiator handling

    In some cases there could be possible dereferencing freed pointer. The
    update is intended to avoid this issue.
Signed-off-by: default avatarYuri Ershov <ext-yuri.ershov@nokia.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>

Cc: Petri Karhula <petri.karhula@nokia.com>
Signed-off-by: default avatarLuis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent a98aa7ae
...@@ -1480,18 +1480,18 @@ static int __regulatory_hint(struct wiphy *wiphy, ...@@ -1480,18 +1480,18 @@ static int __regulatory_hint(struct wiphy *wiphy,
} }
/* This processes *all* regulatory hints */ /* This processes *all* regulatory hints */
static void reg_process_hint(struct regulatory_request *reg_request) static void reg_process_hint(struct regulatory_request *reg_request,
enum nl80211_reg_initiator reg_initiator)
{ {
int r = 0; int r = 0;
struct wiphy *wiphy = NULL; struct wiphy *wiphy = NULL;
enum nl80211_reg_initiator initiator = reg_request->initiator;
BUG_ON(!reg_request->alpha2); BUG_ON(!reg_request->alpha2);
if (wiphy_idx_valid(reg_request->wiphy_idx)) if (wiphy_idx_valid(reg_request->wiphy_idx))
wiphy = wiphy_idx_to_wiphy(reg_request->wiphy_idx); wiphy = wiphy_idx_to_wiphy(reg_request->wiphy_idx);
if (reg_request->initiator == NL80211_REGDOM_SET_BY_DRIVER && if (reg_initiator == NL80211_REGDOM_SET_BY_DRIVER &&
!wiphy) { !wiphy) {
kfree(reg_request); kfree(reg_request);
return; return;
...@@ -1501,7 +1501,7 @@ static void reg_process_hint(struct regulatory_request *reg_request) ...@@ -1501,7 +1501,7 @@ static void reg_process_hint(struct regulatory_request *reg_request)
/* This is required so that the orig_* parameters are saved */ /* This is required so that the orig_* parameters are saved */
if (r == -EALREADY && wiphy && if (r == -EALREADY && wiphy &&
wiphy->flags & WIPHY_FLAG_STRICT_REGULATORY) { wiphy->flags & WIPHY_FLAG_STRICT_REGULATORY) {
wiphy_update_regulatory(wiphy, initiator); wiphy_update_regulatory(wiphy, reg_initiator);
return; return;
} }
...@@ -1510,7 +1510,7 @@ static void reg_process_hint(struct regulatory_request *reg_request) ...@@ -1510,7 +1510,7 @@ static void reg_process_hint(struct regulatory_request *reg_request)
* source of bogus requests. * source of bogus requests.
*/ */
if (r != -EALREADY && if (r != -EALREADY &&
reg_request->initiator == NL80211_REGDOM_SET_BY_USER) reg_initiator == NL80211_REGDOM_SET_BY_USER)
schedule_delayed_work(&reg_timeout, msecs_to_jiffies(3142)); schedule_delayed_work(&reg_timeout, msecs_to_jiffies(3142));
} }
...@@ -1547,7 +1547,7 @@ static void reg_process_pending_hints(void) ...@@ -1547,7 +1547,7 @@ static void reg_process_pending_hints(void)
spin_unlock(&reg_requests_lock); spin_unlock(&reg_requests_lock);
reg_process_hint(reg_request); reg_process_hint(reg_request, reg_request->initiator);
out: out:
mutex_unlock(&reg_mutex); mutex_unlock(&reg_mutex);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment