Commit 9fe271af authored by Johannes Berg's avatar Johannes Berg

nl80211: fix error path in nl80211_get_key()

Coverity pointed out that in the (practically impossible)
error case we leak the message - fix this.
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent ae917c9f
...@@ -2687,7 +2687,7 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info) ...@@ -2687,7 +2687,7 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info)
hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0,
NL80211_CMD_NEW_KEY); NL80211_CMD_NEW_KEY);
if (!hdr) if (!hdr)
return -ENOBUFS; goto nla_put_failure;
cookie.msg = msg; cookie.msg = msg;
cookie.idx = key_idx; cookie.idx = key_idx;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment