From: Zheng Yongjun Date: Thu, 4 Feb 2021 07:42:54 +0000 (+0800) Subject: xfrm: Return the correct errno code X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=4ac7a6eecbec90c7f83d5ea6f0498d9fa9c62917;p=linux.git xfrm: Return the correct errno code When kalloc or kmemdup failed, should return ENOMEM rather than ENOBUF. Signed-off-by: Zheng Yongjun Signed-off-by: Steffen Klassert --- diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index 0727ac853b550..5a0ef4361e436 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);