Skip to content

Commit

Permalink
fib: Return the correct errno code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Zheng Yongjun authored and davem330 committed Jun 3, 2021
1 parent 49251cd commit 5960786
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/core/fib_rules.c
Original file line number Diff line number Diff line change
Expand Up @@ -1168,7 +1168,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);
Expand Down

0 comments on commit 5960786

Please sign in to comment.