summaryrefslogtreecommitdiff
path: root/net/sched
diff options
context:
space:
mode:
authorZheng Yongjun <zhengyongjun3@huawei.com>2021-02-04 10:39:50 +0300
committerJakub Kicinski <kuba@kernel.org>2021-02-06 22:15:28 +0300
commita64566a22b6a943105b01f47e8ae97779cab1417 (patch)
tree78676c548c9fd1381973d66c5927ae6790dedbeb /net/sched
parent247b557ee52a8f404d79d365ac6b2c94d7332381 (diff)
downloadlinux-a64566a22b6a943105b01f47e8ae97779cab1417.tar.xz
net: sched: Return the correct errno code
When kalloc or kmemdup failed, should return ENOMEM rather than ENOBUF. Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com> Link: https://lore.kernel.org/r/20210204073950.18372-1-zhengyongjun3@huawei.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/sched')
-rw-r--r--net/sched/em_nbyte.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sched/em_nbyte.c b/net/sched/em_nbyte.c
index 2c1192a2ee5e..a83b237cbeb0 100644
--- a/net/sched/em_nbyte.c
+++ b/net/sched/em_nbyte.c
@@ -31,7 +31,7 @@ static int em_nbyte_change(struct net *net, void *data, int data_len,
em->datalen = sizeof(*nbyte) + nbyte->len;
em->data = (unsigned long)kmemdup(data, em->datalen, GFP_KERNEL);
if (em->data == 0UL)
- return -ENOBUFS;
+ return -ENOMEM;
return 0;
}