From: Luis R. Rodriguez Date: Wed, 12 Nov 2008 22:22:01 +0000 (-0800) Subject: cfg80211: mark regdomains with > NL80211_MAX_SUPP_REG_RULES invalid X-Git-Tag: v2.6.29-rc1~581^2~383^2~70 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=88dc1c3f7f9058cd5ceae1e4b53453484c7b0364;p=~shefty%2Frdma-dev.git 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 Acked-by: Johannes Berg Signed-off-by: John W. Linville --- diff --git a/net/wireless/reg.c b/net/wireless/reg.c index f8e7beb23ad..f0ff3d1779d 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))