diff options
author | Zheng Yongjun <zhengyongjun3@huawei.com> | 2021-02-04 15:42:54 +0800 |
---|---|---|
committer | Steffen Klassert <steffen.klassert@secunet.com> | 2021-02-04 09:29:27 +0100 |
commit | 4ac7a6eecbec90c7f83d5ea6f0498d9fa9c62917 (patch) | |
tree | 611bb2ce05cac8edb7be5407f75044e0e24de508 /net/xfrm | |
parent | bf3da527bbc9f0a83a02f4ad3fb762eafdd63ba0 (diff) | |
download | linux-stable-4ac7a6eecbec90c7f83d5ea6f0498d9fa9c62917.tar.gz linux-stable-4ac7a6eecbec90c7f83d5ea6f0498d9fa9c62917.tar.bz2 linux-stable-4ac7a6eecbec90c7f83d5ea6f0498d9fa9c62917.zip |
xfrm: Return the correct errno code
When kalloc or kmemdup failed, should return ENOMEM rather than ENOBUF.
Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'net/xfrm')
-rw-r--r-- | net/xfrm/xfrm_user.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index 0727ac853b55..5a0ef4361e43 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c @@ -2504,7 +2504,7 @@ static int xfrm_do_migrate(struct sk_buff *skb, struct nlmsghdr *nlh, encap = kmemdup(nla_data(attrs[XFRMA_ENCAP]), sizeof(*encap), GFP_KERNEL); if (!encap) - return 0; + return -ENOMEM; } err = xfrm_migrate(&pi->sel, pi->dir, type, m, n, kmp, net, encap); |