diff options
author | Luis R. Rodriguez <mcgrof@qca.qualcomm.com> | 2011-12-20 15:23:36 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-01-04 14:30:40 -0500 |
commit | 8848bef0382af53a7c9568bbc6757db97c53a0e3 (patch) | |
tree | b92592b1aa3095e441d64f0de28899cdc24e0c1a /net | |
parent | a98aa7ae14529144527b64a54a9ecd828fa805a6 (diff) |
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 c4c322941ce0d7e2b7b8794ad70683123d9cb26a
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: Yuri Ershov <ext-yuri.ershov@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Cc: Petri Karhula <petri.karhula@nokia.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/wireless/reg.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c index 58d393766035..728a8fdf04b3 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c | |||
@@ -1480,18 +1480,18 @@ new_request: | |||
1480 | } | 1480 | } |
1481 | 1481 | ||
1482 | /* This processes *all* regulatory hints */ | 1482 | /* This processes *all* regulatory hints */ |
1483 | static void reg_process_hint(struct regulatory_request *reg_request) | 1483 | static void reg_process_hint(struct regulatory_request *reg_request, |
1484 | enum nl80211_reg_initiator reg_initiator) | ||
1484 | { | 1485 | { |
1485 | int r = 0; | 1486 | int r = 0; |
1486 | struct wiphy *wiphy = NULL; | 1487 | struct wiphy *wiphy = NULL; |
1487 | enum nl80211_reg_initiator initiator = reg_request->initiator; | ||
1488 | 1488 | ||
1489 | BUG_ON(!reg_request->alpha2); | 1489 | BUG_ON(!reg_request->alpha2); |
1490 | 1490 | ||
1491 | if (wiphy_idx_valid(reg_request->wiphy_idx)) | 1491 | if (wiphy_idx_valid(reg_request->wiphy_idx)) |
1492 | wiphy = wiphy_idx_to_wiphy(reg_request->wiphy_idx); | 1492 | wiphy = wiphy_idx_to_wiphy(reg_request->wiphy_idx); |
1493 | 1493 | ||
1494 | if (reg_request->initiator == NL80211_REGDOM_SET_BY_DRIVER && | 1494 | if (reg_initiator == NL80211_REGDOM_SET_BY_DRIVER && |
1495 | !wiphy) { | 1495 | !wiphy) { |
1496 | kfree(reg_request); | 1496 | kfree(reg_request); |
1497 | return; | 1497 | return; |
@@ -1501,7 +1501,7 @@ static void reg_process_hint(struct regulatory_request *reg_request) | |||
1501 | /* This is required so that the orig_* parameters are saved */ | 1501 | /* This is required so that the orig_* parameters are saved */ |
1502 | if (r == -EALREADY && wiphy && | 1502 | if (r == -EALREADY && wiphy && |
1503 | wiphy->flags & WIPHY_FLAG_STRICT_REGULATORY) { | 1503 | wiphy->flags & WIPHY_FLAG_STRICT_REGULATORY) { |
1504 | wiphy_update_regulatory(wiphy, initiator); | 1504 | wiphy_update_regulatory(wiphy, reg_initiator); |
1505 | return; | 1505 | return; |
1506 | } | 1506 | } |
1507 | 1507 | ||
@@ -1510,7 +1510,7 @@ static void reg_process_hint(struct regulatory_request *reg_request) | |||
1510 | * source of bogus requests. | 1510 | * source of bogus requests. |
1511 | */ | 1511 | */ |
1512 | if (r != -EALREADY && | 1512 | if (r != -EALREADY && |
1513 | reg_request->initiator == NL80211_REGDOM_SET_BY_USER) | 1513 | reg_initiator == NL80211_REGDOM_SET_BY_USER) |
1514 | schedule_delayed_work(®_timeout, msecs_to_jiffies(3142)); | 1514 | schedule_delayed_work(®_timeout, msecs_to_jiffies(3142)); |
1515 | } | 1515 | } |
1516 | 1516 | ||
@@ -1547,7 +1547,7 @@ static void reg_process_pending_hints(void) | |||
1547 | 1547 | ||
1548 | spin_unlock(®_requests_lock); | 1548 | spin_unlock(®_requests_lock); |
1549 | 1549 | ||
1550 | reg_process_hint(reg_request); | 1550 | reg_process_hint(reg_request, reg_request->initiator); |
1551 | 1551 | ||
1552 | out: | 1552 | out: |
1553 | mutex_unlock(®_mutex); | 1553 | mutex_unlock(®_mutex); |