]> Git Repo - linux.git/commitdiff
xfrm: Return the correct errno code
authorZheng Yongjun <[email protected]>
Thu, 4 Feb 2021 07:42:54 +0000 (15:42 +0800)
committerSteffen Klassert <[email protected]>
Thu, 4 Feb 2021 08:29:27 +0000 (09:29 +0100)
When kalloc or kmemdup failed, should return ENOMEM rather than ENOBUF.

Signed-off-by: Zheng Yongjun <[email protected]>
Signed-off-by: Steffen Klassert <[email protected]>
net/xfrm/xfrm_user.c

index 0727ac853b5509e0500c93db77ecc113bf358612..5a0ef4361e436a8ab4a5252e97583ce5b6d3dc83 100644 (file)
@@ -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);
This page took 0.059089 seconds and 4 git commands to generate.