From: Zheng Yongjun Date: Wed, 2 Jun 2021 14:06:58 +0000 (+0800) Subject: fib: Return the correct errno code X-Git-Tag: v5.4.127~1 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=f7afaf778591e21a7f610c3f248b51615a51a0e5;p=users%2Fdwmw2%2Flinux.git 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 Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c index bb11fc87bbaef..675f27ef6872f 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);