Skip to content

Commit

Permalink
cfg80211: mark regdomains with > NL80211_MAX_SUPP_REG_RULES invalid
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Luis R. Rodriguez authored and John W. Linville committed Nov 25, 2008
1 parent 02ba0b3 commit 88dc1c3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/wireless/reg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 88dc1c3

Please sign in to comment.