diff options
author | Zheng Yongjun <zhengyongjun3@huawei.com> | 2021-02-04 15:39:50 +0800 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2021-02-06 11:15:28 -0800 |
commit | a64566a22b6a943105b01f47e8ae97779cab1417 (patch) | |
tree | 78676c548c9fd1381973d66c5927ae6790dedbeb /net | |
parent | 247b557ee52a8f404d79d365ac6b2c94d7332381 (diff) |
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')
-rw-r--r-- | net/sched/em_nbyte.c | 2 |
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; } |