diff options
author | Luis R. Rodriguez <lrodriguez@atheros.com> | 2009-05-13 17:04:39 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-07-02 16:50:09 -0700 |
commit | a08b8fc14b865bc751c6b83b1fab5f0ad3225c11 (patch) | |
tree | e55c0d47bc7b7bb672ce2461deb444e4e74b2c3e /net | |
parent | 2596f0a38069879ad4aec95a8f932075054ad6ba (diff) |
cfg80211: return immediately if num reg rules > NL80211_MAX_SUPP_REG_RULES
commit 4776c6e7f66f853011bc1fd6fe37fa63f0b6982c upstream.
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.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'net')
-rw-r--r-- | net/wireless/nl80211.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index f1a30def64d..641e3e26c09 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -2385,7 +2385,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)) { |