All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH net-next] xfrm: Return the correct errno code
  2021-06-04  1:46 [PATCH net-next] xfrm: Return the correct errno code Zheng Yongjun
@ 2021-06-04  1:34 ` Herbert Xu
  0 siblings, 0 replies; 4+ messages in thread
From: Herbert Xu @ 2021-06-04  1:34 UTC (permalink / raw)
  To: Zheng Yongjun; +Cc: steffen.klassert, davem, kuba, netdev, linux-kernel

On Fri, Jun 04, 2021 at 09:46:52AM +0800, Zheng Yongjun wrote:
> When kalloc or kmemdup failed, should return ENOMEM rather than ENOBUF.
> 
> Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
> ---
>  net/xfrm/xfrm_user.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
> index f0aecee4d539..4f9c86807bc4 100644
> --- a/net/xfrm/xfrm_user.c
> +++ b/net/xfrm/xfrm_user.c
> @@ -3159,7 +3159,7 @@ static struct xfrm_policy *xfrm_compile_policy(struct sock *sk, int opt,
>  
>  	xp = xfrm_policy_alloc(net, GFP_ATOMIC);
>  	if (xp == NULL) {
> -		*dir = -ENOBUFS;
> +		*dir = -ENOMEM;

Nack.  ENOBUFS has a specific meaning in the network stack.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH net-next] xfrm: Return the correct errno code
@ 2021-06-04  1:46 Zheng Yongjun
  2021-06-04  1:34 ` Herbert Xu
  0 siblings, 1 reply; 4+ messages in thread
From: Zheng Yongjun @ 2021-06-04  1:46 UTC (permalink / raw)
  To: steffen.klassert, herbert, davem, kuba, netdev, linux-kernel
  Cc: Zheng Yongjun

When kalloc or kmemdup failed, should return ENOMEM rather than ENOBUF.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
---
 net/xfrm/xfrm_user.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index f0aecee4d539..4f9c86807bc4 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -3159,7 +3159,7 @@ static struct xfrm_policy *xfrm_compile_policy(struct sock *sk, int opt,
 
 	xp = xfrm_policy_alloc(net, GFP_ATOMIC);
 	if (xp == NULL) {
-		*dir = -ENOBUFS;
+		*dir = -ENOMEM;
 		return NULL;
 	}
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] xfrm: Return the correct errno code
  2021-02-04  7:42 Zheng Yongjun
@ 2021-02-06  7:12 ` Steffen Klassert
  0 siblings, 0 replies; 4+ messages in thread
From: Steffen Klassert @ 2021-02-06  7:12 UTC (permalink / raw)
  To: Zheng Yongjun; +Cc: herbert, davem, kuba, netdev, linux-kernel

On Thu, Feb 04, 2021 at 03:42:54PM +0800, Zheng Yongjun wrote:
> When kalloc or kmemdup failed, should return ENOMEM rather than ENOBUF.
> 
> Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>

Applied to ipsec-next, thanks!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH net-next] xfrm: Return the correct errno code
@ 2021-02-04  7:42 Zheng Yongjun
  2021-02-06  7:12 ` Steffen Klassert
  0 siblings, 1 reply; 4+ messages in thread
From: Zheng Yongjun @ 2021-02-04  7:42 UTC (permalink / raw)
  To: steffen.klassert, herbert, davem, kuba, netdev, linux-kernel
  Cc: Zheng Yongjun

When kalloc or kmemdup failed, should return ENOMEM rather than ENOBUF.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
---
 net/xfrm/xfrm_user.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index d0c32a8fcc4a..ad63a6c77edd 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -2444,7 +2444,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);
-- 
2.22.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-06-04  1:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-04  1:46 [PATCH net-next] xfrm: Return the correct errno code Zheng Yongjun
2021-06-04  1:34 ` Herbert Xu
  -- strict thread matches above, loose matches on Subject: below --
2021-02-04  7:42 Zheng Yongjun
2021-02-06  7:12 ` Steffen Klassert

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.