diff options
author | Johannes Berg <johannes.berg@intel.com> | 2018-12-15 04:03:22 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2018-12-19 03:40:17 -0500 |
commit | d350a0f431189517b1af0dbbb605c273231a8966 (patch) | |
tree | de90deadfe27057b77b99c3d7fe3b4fac0b69f54 /net/wireless | |
parent | a50e5fb8db83c5b57392204c21ea6c5c4ccefde6 (diff) |
nl80211: fix memory leak if validate_pae_over_nl80211() fails
If validate_pae_over_nl80211() were to fail in nl80211_crypto_settings(),
we might leak the 'connkeys' allocation. Fix this.
Fixes: 64bf3d4bc2b0 ("nl80211: Add CONTROL_PORT_OVER_NL80211 attribute")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless')
-rw-r--r-- | net/wireless/nl80211.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 8d763725498c..2317727d6413 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -8930,8 +8930,10 @@ static int nl80211_join_ibss(struct sk_buff *skb, struct genl_info *info) | |||
8930 | if (info->attrs[NL80211_ATTR_CONTROL_PORT_OVER_NL80211]) { | 8930 | if (info->attrs[NL80211_ATTR_CONTROL_PORT_OVER_NL80211]) { |
8931 | int r = validate_pae_over_nl80211(rdev, info); | 8931 | int r = validate_pae_over_nl80211(rdev, info); |
8932 | 8932 | ||
8933 | if (r < 0) | 8933 | if (r < 0) { |
8934 | kzfree(connkeys); | ||
8934 | return r; | 8935 | return r; |
8936 | } | ||
8935 | 8937 | ||
8936 | ibss.control_port_over_nl80211 = true; | 8938 | ibss.control_port_over_nl80211 = true; |
8937 | } | 8939 | } |