diff options
Diffstat (limited to 'net/wireless/reg.c')
| -rw-r--r-- | net/wireless/reg.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c index ecfb1a06dbb2..dd58b9909ac9 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c | |||
| @@ -1024,8 +1024,13 @@ static void regdb_fw_cb(const struct firmware *fw, void *context) | |||
| 1024 | } | 1024 | } |
| 1025 | 1025 | ||
| 1026 | rtnl_lock(); | 1026 | rtnl_lock(); |
| 1027 | if (WARN_ON(regdb && !IS_ERR(regdb))) { | 1027 | if (regdb && !IS_ERR(regdb)) { |
| 1028 | /* just restore and free new db */ | 1028 | /* negative case - a bug |
| 1029 | * positive case - can happen due to race in case of multiple cb's in | ||
| 1030 | * queue, due to usage of asynchronous callback | ||
| 1031 | * | ||
| 1032 | * Either case, just restore and free new db. | ||
| 1033 | */ | ||
| 1029 | } else if (set_error) { | 1034 | } else if (set_error) { |
| 1030 | regdb = ERR_PTR(set_error); | 1035 | regdb = ERR_PTR(set_error); |
| 1031 | } else if (fw) { | 1036 | } else if (fw) { |
| @@ -1255,7 +1260,7 @@ static bool is_valid_rd(const struct ieee80211_regdomain *rd) | |||
| 1255 | * definitions (the "2.4 GHz band", the "5 GHz band" and the "60GHz band"), | 1260 | * definitions (the "2.4 GHz band", the "5 GHz band" and the "60GHz band"), |
| 1256 | * however it is safe for now to assume that a frequency rule should not be | 1261 | * however it is safe for now to assume that a frequency rule should not be |
| 1257 | * part of a frequency's band if the start freq or end freq are off by more | 1262 | * part of a frequency's band if the start freq or end freq are off by more |
| 1258 | * than 2 GHz for the 2.4 and 5 GHz bands, and by more than 10 GHz for the | 1263 | * than 2 GHz for the 2.4 and 5 GHz bands, and by more than 20 GHz for the |
| 1259 | * 60 GHz band. | 1264 | * 60 GHz band. |
| 1260 | * This resolution can be lowered and should be considered as we add | 1265 | * This resolution can be lowered and should be considered as we add |
| 1261 | * regulatory rule support for other "bands". | 1266 | * regulatory rule support for other "bands". |
| @@ -1270,7 +1275,7 @@ static bool freq_in_rule_band(const struct ieee80211_freq_range *freq_range, | |||
| 1270 | * with the Channel starting frequency above 45 GHz. | 1275 | * with the Channel starting frequency above 45 GHz. |
| 1271 | */ | 1276 | */ |
| 1272 | u32 limit = freq_khz > 45 * ONE_GHZ_IN_KHZ ? | 1277 | u32 limit = freq_khz > 45 * ONE_GHZ_IN_KHZ ? |
| 1273 | 10 * ONE_GHZ_IN_KHZ : 2 * ONE_GHZ_IN_KHZ; | 1278 | 20 * ONE_GHZ_IN_KHZ : 2 * ONE_GHZ_IN_KHZ; |
| 1274 | if (abs(freq_khz - freq_range->start_freq_khz) <= limit) | 1279 | if (abs(freq_khz - freq_range->start_freq_khz) <= limit) |
| 1275 | return true; | 1280 | return true; |
| 1276 | if (abs(freq_khz - freq_range->end_freq_khz) <= limit) | 1281 | if (abs(freq_khz - freq_range->end_freq_khz) <= limit) |
