aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZheng Yongjun <zhengyongjun3@huawei.com>2021-06-02 22:06:58 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-06-18 09:59:00 +0200
commitf7afaf778591e21a7f610c3f248b51615a51a0e5 (patch)
tree25924f7dacf66577cc079811dd7274cdeb2497e6
parent51cc5ad292dac192cfcdf25bd6f098f3d67e3ec6 (diff)
downloadlinux-yocto-f7afaf778591e21a7f610c3f248b51615a51a0e5.tar.gz
linux-yocto-f7afaf778591e21a7f610c3f248b51615a51a0e5.tar.bz2
linux-yocto-f7afaf778591e21a7f610c3f248b51615a51a0e5.zip
fib: Return the correct errno code
[ Upstream commit 59607863c54e9eb3f69afc5257dfe71c38bb751e ] When kalloc or kmemdup failed, should return ENOMEM rather than ENOBUF. Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--net/core/fib_rules.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c
index bb11fc87bbae..675f27ef6872 100644
--- a/net/core/fib_rules.c
+++ b/net/core/fib_rules.c
@@ -1138,7 +1138,7 @@ static void notify_rule_change(int event, struct fib_rule *rule,
{
struct net *net;
struct sk_buff *skb;
- int err = -ENOBUFS;
+ int err = -ENOMEM;
net = ops->fro_net;
skb = nlmsg_new(fib_rule_nlmsg_size(ops, rule), GFP_KERNEL);