[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20210204073229.18064-1-zhengyongjun3@huawei.com>
Date: Thu, 4 Feb 2021 15:32:29 +0800
From: Zheng Yongjun <zhengyongjun3@...wei.com>
To: <davem@...emloft.net>, <kuba@...nel.org>, <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 kalloc or kmemdup failed, should return ENOMEM rather than ENOBUF.
Signed-off-by: Zheng Yongjun <zhengyongjun3@...wei.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
Powered by blists - more mailing lists