Skip to content

Commit

Permalink
cfg80211: return immediately if num reg rules > NL80211_MAX_SUPP_REG_…
Browse files Browse the repository at this point in the history
…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: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Luis R. Rodriguez authored and John W. Linville committed May 20, 2009
1 parent e74fbb4 commit 4776c6e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/wireless/nl80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 4776c6e

Please sign in to comment.