diff mbox series

[net-next] net: Return the correct errno code

Message ID 20210204085630.19452-1-zhengyongjun3@huawei.com (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series [net-next] net: Return the correct errno code | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net-next
netdev/subject_prefix success Link
netdev/cc_maintainers warning 4 maintainers not CCed: rdna@fb.com laniel_francis@privacyrequired.com usuraj35@gmail.com keescook@chromium.org
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 24 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success Link
netdev/stable success Stable not CCed

Commit Message

Zheng Yongjun Feb. 4, 2021, 8:56 a.m. UTC
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(-)

Comments

Jesse Brandeburg Feb. 4, 2021, 7:14 p.m. UTC | #1
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.
Jakub Kicinski Feb. 6, 2021, 7:18 p.m. UTC | #2
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.
diff mbox series

Patch

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;