diff options
author | Luis R. Rodriguez <lrodriguez@atheros.com> | 2008-11-12 14:22:01 -0800 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-11-25 16:41:25 -0500 |
commit | 88dc1c3f7f9058cd5ceae1e4b53453484c7b0364 (patch) | |
tree | 47a2cf73d22d4d49e8c388f267f307221cf2d2b2 /net | |
parent | 02ba0b3263f4eb41d2a5714cbe99207ae491a964 (diff) | |
download | linux-88dc1c3f7f9058cd5ceae1e4b53453484c7b0364.tar.gz linux-88dc1c3f7f9058cd5ceae1e4b53453484c7b0364.tar.bz2 linux-88dc1c3f7f9058cd5ceae1e4b53453484c7b0364.zip |
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')
-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) if (!rd->n_reg_rules) return false; + if (WARN_ON(rd->n_reg_rules > NL80211_MAX_SUPP_REG_RULES)) + return false; + for (i = 0; i < rd->n_reg_rules; i++) { reg_rule = &rd->reg_rules[i]; if (!is_valid_reg_rule(reg_rule)) |