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>
This commit is contained in:
parent
247b557ee5
commit
a64566a22b
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue