Skip to content

Commit

Permalink
nl80211: Fix potential memory leak in nl80211_connect
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ola Olsson authored and Johannes Berg committed Dec 15, 2015
1 parent e5dbe07 commit 707554b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/wireless/nl80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 707554b

Please sign in to comment.