Re: [PATCH] nl80211: Fix potential memory leak in nl80211_connect

2015-12-15 Thread Johannes Berg
On Fri, 2015-12-11 at 21:04 +0100, Ola Olsson wrote:
> Free cached keys if the last early return path is taken.
> 
Also applied, thanks.

johannes
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] nl80211: Fix potential memory leak in nl80211_connect

2015-12-11 Thread Ola Olsson
Free cached keys if the last early return path is taken.

Signed-off-by: Ola Olsson 
---
 net/wireless/nl80211.c |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index c71e274..4b5ff71 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;
}
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html