diff options
author | Luis R. Rodriguez <lrodriguez@atheros.com> | 2009-05-13 23:04:39 +0200 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-05-20 20:46:31 +0200 |
commit | 4776c6e7f66f853011bc1fd6fe37fa63f0b6982c (patch) | |
tree | 9e443ddbc9ad25924b7285b0b8a0c0e1b958fc54 /net/wireless | |
parent | wireless: fix to set dev->broadcast correctly (diff) | |
download | linux-4776c6e7f66f853011bc1fd6fe37fa63f0b6982c.tar.xz linux-4776c6e7f66f853011bc1fd6fe37fa63f0b6982c.zip |
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: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless')
-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 1cf57f53a283..52a877998ff7 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -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)) |