cfg80211: mark regdomains with > NL80211_MAX_SUPP_REG_RULES invalid
authorLuis R. Rodriguez <lrodriguez@atheros.com>
Wed, 12 Nov 2008 22:22:01 +0000 (14:22 -0800)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 25 Nov 2008 21:41:25 +0000 (16:41 -0500)
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>
net/wireless/reg.c

index f8e7beb23add9c26d5fbe9b03ba3f3dbb15a7e7c..f0ff3d1779dafa10b2b5a16aa88846fcd850a0f7 100644 (file)
@@ -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))