Skip to content

Commit

Permalink
xfrm: Return the correct errno code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Zheng Yongjun authored and Steffen Klassert committed Feb 4, 2021
1 parent bf3da52 commit 4ac7a6e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/xfrm/xfrm_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 4ac7a6e

Please sign in to comment.