diff options
Diffstat (limited to 'net/wireless')
-rw-r--r-- | net/wireless/nl80211.c | 6 | ||||
-rw-r--r-- | net/wireless/util.c | 11 |
2 files changed, 11 insertions, 6 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 9b62710891a2..864ddfbeff2f 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -2718,7 +2718,7 @@ static int nl80211_get_mesh_config(struct sk_buff *skb, | |||
2718 | hdr = nl80211hdr_put(msg, info->snd_pid, info->snd_seq, 0, | 2718 | hdr = nl80211hdr_put(msg, info->snd_pid, info->snd_seq, 0, |
2719 | NL80211_CMD_GET_MESH_CONFIG); | 2719 | NL80211_CMD_GET_MESH_CONFIG); |
2720 | if (!hdr) | 2720 | if (!hdr) |
2721 | goto nla_put_failure; | 2721 | goto out; |
2722 | pinfoattr = nla_nest_start(msg, NL80211_ATTR_MESH_CONFIG); | 2722 | pinfoattr = nla_nest_start(msg, NL80211_ATTR_MESH_CONFIG); |
2723 | if (!pinfoattr) | 2723 | if (!pinfoattr) |
2724 | goto nla_put_failure; | 2724 | goto nla_put_failure; |
@@ -2759,6 +2759,7 @@ static int nl80211_get_mesh_config(struct sk_buff *skb, | |||
2759 | 2759 | ||
2760 | nla_put_failure: | 2760 | nla_put_failure: |
2761 | genlmsg_cancel(msg, hdr); | 2761 | genlmsg_cancel(msg, hdr); |
2762 | out: | ||
2762 | nlmsg_free(msg); | 2763 | nlmsg_free(msg); |
2763 | return -ENOBUFS; | 2764 | return -ENOBUFS; |
2764 | } | 2765 | } |
@@ -2954,7 +2955,7 @@ static int nl80211_get_reg(struct sk_buff *skb, struct genl_info *info) | |||
2954 | hdr = nl80211hdr_put(msg, info->snd_pid, info->snd_seq, 0, | 2955 | hdr = nl80211hdr_put(msg, info->snd_pid, info->snd_seq, 0, |
2955 | NL80211_CMD_GET_REG); | 2956 | NL80211_CMD_GET_REG); |
2956 | if (!hdr) | 2957 | if (!hdr) |
2957 | goto nla_put_failure; | 2958 | goto put_failure; |
2958 | 2959 | ||
2959 | NLA_PUT_STRING(msg, NL80211_ATTR_REG_ALPHA2, | 2960 | NLA_PUT_STRING(msg, NL80211_ATTR_REG_ALPHA2, |
2960 | cfg80211_regdomain->alpha2); | 2961 | cfg80211_regdomain->alpha2); |
@@ -3001,6 +3002,7 @@ static int nl80211_get_reg(struct sk_buff *skb, struct genl_info *info) | |||
3001 | 3002 | ||
3002 | nla_put_failure: | 3003 | nla_put_failure: |
3003 | genlmsg_cancel(msg, hdr); | 3004 | genlmsg_cancel(msg, hdr); |
3005 | put_failure: | ||
3004 | nlmsg_free(msg); | 3006 | nlmsg_free(msg); |
3005 | err = -EMSGSIZE; | 3007 | err = -EMSGSIZE; |
3006 | out: | 3008 | out: |
diff --git a/net/wireless/util.c b/net/wireless/util.c index 4ed065d8bb51..6a750bc6bcfe 100644 --- a/net/wireless/util.c +++ b/net/wireless/util.c | |||
@@ -167,12 +167,15 @@ int cfg80211_validate_key_settings(struct cfg80211_registered_device *rdev, | |||
167 | 167 | ||
168 | /* | 168 | /* |
169 | * Disallow pairwise keys with non-zero index unless it's WEP | 169 | * Disallow pairwise keys with non-zero index unless it's WEP |
170 | * (because current deployments use pairwise WEP keys with | 170 | * or a vendor specific cipher (because current deployments use |
171 | * non-zero indizes but 802.11i clearly specifies to use zero) | 171 | * pairwise WEP keys with non-zero indices and for vendor specific |
172 | * ciphers this should be validated in the driver or hardware level | ||
173 | * - but 802.11i clearly specifies to use zero) | ||
172 | */ | 174 | */ |
173 | if (pairwise && key_idx && | 175 | if (pairwise && key_idx && |
174 | params->cipher != WLAN_CIPHER_SUITE_WEP40 && | 176 | ((params->cipher == WLAN_CIPHER_SUITE_TKIP) || |
175 | params->cipher != WLAN_CIPHER_SUITE_WEP104) | 177 | (params->cipher == WLAN_CIPHER_SUITE_CCMP) || |
178 | (params->cipher == WLAN_CIPHER_SUITE_AES_CMAC))) | ||
176 | return -EINVAL; | 179 | return -EINVAL; |
177 | 180 | ||
178 | switch (params->cipher) { | 181 | switch (params->cipher) { |