Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4776c6e7 authored by Luis R. Rodriguez's avatar Luis R. Rodriguez Committed by John W. Linville
Browse files

cfg80211: return immediately if num reg rules > NL80211_MAX_SUPP_REG_RULES



This has no functional change except we save a kfree(rd) and
allows us to clean this code up a bit after this. We do
avoid an unnecessary kfree(NULL) but calling that was OK too.

Cc: stable@kernel.org
Signed-off-by: default avatarLuis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent e74fbb41
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2567,7 +2567,7 @@ static int nl80211_set_reg(struct sk_buff *skb, struct genl_info *info)
			rem_reg_rules) {
		num_rules++;
		if (num_rules > NL80211_MAX_SUPP_REG_RULES)
			goto bad_reg;
			return -EINVAL;
	}

	if (!reg_is_valid_request(alpha2))