diff options
author | Luis R. Rodriguez <lrodriguez@atheros.com> | 2008-11-12 17:22:01 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-11-25 16:41:25 -0500 |
commit | 88dc1c3f7f9058cd5ceae1e4b53453484c7b0364 (patch) | |
tree | 47a2cf73d22d4d49e8c388f267f307221cf2d2b2 /net/wireless/reg.c | |
parent | 02ba0b3263f4eb41d2a5714cbe99207ae491a964 (diff) |
cfg80211: mark regdomains with > NL80211_MAX_SUPP_REG_RULES invalid
Lets remain consistent and mark rds with > NL80211_MAX_SUPP_REG_RULES
number of reg rules as invalid in is_valid_rd().
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless/reg.c')
-rw-r--r-- | net/wireless/reg.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c index f8e7beb23add..f0ff3d1779da 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c | |||
@@ -352,6 +352,9 @@ static bool is_valid_rd(const struct ieee80211_regdomain *rd) | |||
352 | if (!rd->n_reg_rules) | 352 | if (!rd->n_reg_rules) |
353 | return false; | 353 | return false; |
354 | 354 | ||
355 | if (WARN_ON(rd->n_reg_rules > NL80211_MAX_SUPP_REG_RULES)) | ||
356 | return false; | ||
357 | |||
355 | for (i = 0; i < rd->n_reg_rules; i++) { | 358 | for (i = 0; i < rd->n_reg_rules; i++) { |
356 | reg_rule = &rd->reg_rules[i]; | 359 | reg_rule = &rd->reg_rules[i]; |
357 | if (!is_valid_reg_rule(reg_rule)) | 360 | if (!is_valid_reg_rule(reg_rule)) |