[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210204085630.19452-1-zhengyongjun3@huawei.com>
Date: Thu, 4 Feb 2021 16:56:30 +0800
From: Zheng Yongjun <zhengyongjun3@...wei.com>
To: <davem@...emloft.net>, <kuba@...nel.org>,
<linux-decnet-user@...ts.sourceforge.net>,
<netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>
CC: Zheng Yongjun <zhengyongjun3@...wei.com>
Subject: [PATCH net-next] net: Return the correct errno code
When kzalloc failed, should return ENOMEM rather than ENOBUFS.
Signed-off-by: Zheng Yongjun <zhengyongjun3@...wei.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
Powered by blists - more mailing lists