summaryrefslogtreecommitdiffstats
path: root/net/key
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2019-07-08 19:48:57 -0700
committerDavid S. Miller <davem@davemloft.net>2019-07-08 19:48:57 -0700
commitaf144a983402f7fd324ce556d9f9011a8b3e01fe (patch)
tree7a0250b960a36976bc683789d9fe86b9f60a97a5 /net/key
parent6413139dfc641aaaa30580b59696a5f7ea274194 (diff)
parente858faf556d4e14c750ba1e8852783c6f9520a0e (diff)
downloadlinux-af144a983402f7fd324ce556d9f9011a8b3e01fe.tar.gz
linux-af144a983402f7fd324ce556d9f9011a8b3e01fe.tar.bz2
linux-af144a983402f7fd324ce556d9f9011a8b3e01fe.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Two cases of overlapping changes, nothing fancy. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/key')
-rw-r--r--net/key/af_key.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/net/key/af_key.c b/net/key/af_key.c
index 39b3d95094eb..b67ed3a8486c 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -2436,8 +2436,10 @@ static int key_pol_get_resp(struct sock *sk, struct xfrm_policy *xp, const struc
goto out;
}
err = pfkey_xfrm_policy2msg(out_skb, xp, dir);
- if (err < 0)
+ if (err < 0) {
+ kfree_skb(out_skb);
goto out;
+ }
out_hdr = (struct sadb_msg *) out_skb->data;
out_hdr->sadb_msg_version = hdr->sadb_msg_version;
@@ -2688,8 +2690,10 @@ static int dump_sp(struct xfrm_policy *xp, int dir, int count, void *ptr)
return PTR_ERR(out_skb);
err = pfkey_xfrm_policy2msg(out_skb, xp, dir);
- if (err < 0)
+ if (err < 0) {
+ kfree_skb(out_skb);
return err;
+ }
out_hdr = (struct sadb_msg *) out_skb->data;
out_hdr->sadb_msg_version = pfk->dump.msg_version;