diff options
-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)) |