aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorOla Olsson2015-12-11 21:04:52 +0100
committerJohannes Berg2015-12-15 13:11:26 +0100
commit707554b4d117330e58374990b6c27ded650dc684 (patch)
treebab455c1b2bd8fba19fddea8c15fd8963cee3a21 /net
parente5dbe0701a0d7c6127f313a0f68f960176f0209e (diff)
nl80211: Fix potential memory leak in nl80211_connect
Free cached keys if the last early return path is taken. Signed-off-by: Ola Olsson <ola.olsson@sonymobile.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net')
-rw-r--r--net/wireless/nl80211.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 624174f20b1f..75b0d23ee882 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -7941,8 +7941,10 @@ static int nl80211_connect(struct sk_buff *skb, struct genl_info *info)
if (nla_get_flag(info->attrs[NL80211_ATTR_USE_RRM])) {
if (!(rdev->wiphy.features &
NL80211_FEATURE_DS_PARAM_SET_IE_IN_PROBES) ||
- !(rdev->wiphy.features & NL80211_FEATURE_QUIET))
+ !(rdev->wiphy.features & NL80211_FEATURE_QUIET)) {
+ kzfree(connkeys);
return -EINVAL;
+ }
connect.flags |= ASSOC_REQ_USE_RRM;
}