* [PATCH net-next] net: Return the correct errno code
@ 2021-02-04 8:56 Zheng Yongjun
2021-02-04 19:14 ` Jesse Brandeburg
0 siblings, 1 reply; 8+ messages in thread
From: Zheng Yongjun @ 2021-02-04 8:56 UTC (permalink / raw)
To: davem, kuba, linux-decnet-user, netdev, linux-kernel; +Cc: Zheng Yongjun
When kzalloc failed, should return ENOMEM rather than ENOBUFS.
Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
---
net/decnet/dn_dev.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c
index 15d42353f1a3..50e375dcd5bd 100644
--- a/net/decnet/dn_dev.c
+++ b/net/decnet/dn_dev.c
@@ -469,7 +469,7 @@ int dn_dev_ioctl(unsigned int cmd, void __user *arg)
case SIOCSIFADDR:
if (!ifa) {
if ((ifa = dn_dev_alloc_ifa()) == NULL) {
- ret = -ENOBUFS;
+ ret = -ENOMEM;
break;
}
memcpy(ifa->ifa_label, dev->name, IFNAMSIZ);
@@ -645,7 +645,7 @@ static int dn_nl_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh,
}
if ((ifa = dn_dev_alloc_ifa()) == NULL)
- return -ENOBUFS;
+ return -ENOMEM;
if (tb[IFA_ADDRESS] == NULL)
tb[IFA_ADDRESS] = tb[IFA_LOCAL];
@@ -1088,7 +1088,7 @@ static struct dn_dev *dn_dev_create(struct net_device *dev, int *err)
if (i == DN_DEV_LIST_SIZE)
return NULL;
- *err = -ENOBUFS;
+ *err = -ENOMEM;
if ((dn_db = kzalloc(sizeof(struct dn_dev), GFP_ATOMIC)) == NULL)
return NULL;
--
2.22.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH net-next] net: Return the correct errno code
2021-02-04 8:56 [PATCH net-next] net: Return the correct errno code Zheng Yongjun
@ 2021-02-04 19:14 ` Jesse Brandeburg
2021-02-06 19:18 ` Jakub Kicinski
0 siblings, 1 reply; 8+ messages in thread
From: Jesse Brandeburg @ 2021-02-04 19:14 UTC (permalink / raw)
To: Zheng Yongjun; +Cc: davem, kuba, linux-decnet-user, netdev, linux-kernel
Zheng Yongjun wrote:
> When kzalloc failed, should return ENOMEM rather than ENOBUFS.
All these patches have the same subject and description, couldn't they
just be part of a single series with a good cover letter?
I'm not saying make them a single patch, because that is bad for
bisection, but having them as a single series means we review related
changes at one time, and can comment on them as a group.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net-next] net: Return the correct errno code
2021-02-04 19:14 ` Jesse Brandeburg
@ 2021-02-06 19:18 ` Jakub Kicinski
0 siblings, 0 replies; 8+ messages in thread
From: Jakub Kicinski @ 2021-02-06 19:18 UTC (permalink / raw)
To: Jesse Brandeburg
Cc: Zheng Yongjun, davem, linux-decnet-user, netdev, linux-kernel
On Thu, 4 Feb 2021 11:14:26 -0800 Jesse Brandeburg wrote:
> Zheng Yongjun wrote:
>
> > When kzalloc failed, should return ENOMEM rather than ENOBUFS.
>
> All these patches have the same subject and description, couldn't they
> just be part of a single series with a good cover letter?
Agreed. The patches seem to be lacking clear justification.
Cover letter would be good.
> I'm not saying make them a single patch, because that is bad for
> bisection, but having them as a single series means we review related
> changes at one time, and can comment on them as a group.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH net-next] net: Return the correct errno code
@ 2021-06-02 14:06 Zheng Yongjun
2021-06-03 22:20 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 8+ messages in thread
From: Zheng Yongjun @ 2021-06-02 14:06 UTC (permalink / raw)
To: 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/compat.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/compat.c b/net/compat.c
index ddd15af3a283..210fc3b4d0d8 100644
--- a/net/compat.c
+++ b/net/compat.c
@@ -177,7 +177,7 @@ int cmsghdr_from_user_compat_to_kern(struct msghdr *kmsg, struct sock *sk,
if (kcmlen > stackbuf_size)
kcmsg_base = kcmsg = sock_kmalloc(sk, kcmlen, GFP_KERNEL);
if (kcmsg == NULL)
- return -ENOBUFS;
+ return -ENOMEM;
/* Now copy them over neatly. */
memset(kcmsg, 0, kcmlen);
--
2.25.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH net-next] net: Return the correct errno code
2021-06-02 14:06 Zheng Yongjun
@ 2021-06-03 22:20 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 8+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-06-03 22:20 UTC (permalink / raw)
To: Zheng Yongjun; +Cc: davem, kuba, netdev, linux-kernel
Hello:
This patch was applied to netdev/net.git (refs/heads/master):
On Wed, 2 Jun 2021 22:06:40 +0800 you wrote:
> When kalloc or kmemdup failed, should return ENOMEM rather than ENOBUF.
>
> Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
> ---
> net/compat.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Here is the summary with links:
- [net-next] net: Return the correct errno code
https://git.kernel.org/netdev/net/c/49251cd00228
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH net-next] net: Return the correct errno code
@ 2021-06-01 14:14 Zheng Yongjun
2021-06-02 0:10 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 8+ messages in thread
From: Zheng Yongjun @ 2021-06-01 14:14 UTC (permalink / raw)
To: davem, yoshfuji, dsahern, 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/ipv4/af_inet.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index f17870ee558b..6608a3c475e3 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -318,7 +318,7 @@ static int inet_create(struct net *net, struct socket *sock, int protocol,
WARN_ON(!answer_prot->slab);
- err = -ENOBUFS;
+ err = -ENOMEM;
sk = sk_alloc(net, PF_INET, GFP_KERNEL, answer_prot, kern);
if (!sk)
goto out;
--
2.25.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH net-next] net: Return the correct errno code
2021-06-01 14:14 Zheng Yongjun
@ 2021-06-02 0:10 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 8+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-06-02 0:10 UTC (permalink / raw)
To: Zheng Yongjun; +Cc: davem, yoshfuji, dsahern, kuba, netdev, linux-kernel
Hello:
This patch was applied to netdev/net-next.git (refs/heads/master):
On Tue, 1 Jun 2021 22:14:07 +0800 you wrote:
> When kalloc or kmemdup failed, should return ENOMEM rather than ENOBUF.
>
> Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
> ---
> net/ipv4/af_inet.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Here is the summary with links:
- [net-next] net: Return the correct errno code
https://git.kernel.org/netdev/net-next/c/ca746c55a7e6
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH net-next] net: Return the correct errno code
@ 2021-02-04 7:32 Zheng Yongjun
0 siblings, 0 replies; 8+ messages in thread
From: Zheng Yongjun @ 2021-02-04 7:32 UTC (permalink / raw)
To: 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/mpls/af_mpls.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/mpls/af_mpls.c b/net/mpls/af_mpls.c
index f2868a8a50c3..7e73611c48dd 100644
--- a/net/mpls/af_mpls.c
+++ b/net/mpls/af_mpls.c
@@ -1427,7 +1427,7 @@ static int mpls_dev_sysctl_register(struct net_device *dev,
free:
kfree(table);
out:
- return -ENOBUFS;
+ return -ENOMEM;
}
static void mpls_dev_sysctl_unregister(struct net_device *dev,
--
2.22.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2021-06-03 22:20 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-04 8:56 [PATCH net-next] net: Return the correct errno code Zheng Yongjun
2021-02-04 19:14 ` Jesse Brandeburg
2021-02-06 19:18 ` Jakub Kicinski
-- strict thread matches above, loose matches on Subject: below --
2021-06-02 14:06 Zheng Yongjun
2021-06-03 22:20 ` patchwork-bot+netdevbpf
2021-06-01 14:14 Zheng Yongjun
2021-06-02 0:10 ` patchwork-bot+netdevbpf
2021-02-04 7:32 Zheng Yongjun
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).