]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
cfg80211: return immediately if num reg rules > NL80211_MAX_SUPP_REG_RULES
authorLuis R. Rodriguez <lrodriguez@atheros.com>
Wed, 13 May 2009 21:04:39 +0000 (17:04 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 2 Jul 2009 23:50:09 +0000 (16:50 -0700)
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>
net/wireless/nl80211.c

index f1a30def64d4988208836ee6c21135c2e26fe93d..641e3e26c09cb401468ddb32cddc688b062b294c 100644 (file)
@@ -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)) {