summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLi Zetao <lizetao1@huawei.com>2024-08-22 12:32:44 +0800
committerDavid S. Miller <davem@davemloft.net>2024-08-23 14:27:44 +0100
commit41aa426392be26865a8a774df3e5ec4c56a98b26 (patch)
tree9e138a9784804fa66fd27be96ce29e9402f70be3
parent6ef1ca2d14f2a78a83dfd40e34f53e8d5c1c0b4b (diff)
fib: rules: delete redundant judgment statements
The initial value of err is -ENOMEM, and err is guaranteed to be less than 0 before all goto errout. Therefore, on the error path of errout, there is no need to repeatedly judge that err is less than 0, and delete redundant judgments to make the code more concise. Signed-off-by: Li Zetao <lizetao1@huawei.com> Reviewed-by: Petr Machata <petrm@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/core/fib_rules.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c
index 6ebffbc63236..3c76b835493d 100644
--- a/net/core/fib_rules.c
+++ b/net/core/fib_rules.c
@@ -1205,8 +1205,7 @@ static void notify_rule_change(int event, struct fib_rule *rule,
rtnl_notify(skb, net, pid, ops->nlgroup, nlh, GFP_KERNEL);
return;
errout:
- if (err < 0)
- rtnl_set_sk_err(net, ops->nlgroup, err);
+ rtnl_set_sk_err(net, ops->nlgroup, err);
}
static void attach_rules(struct list_head *rules, struct net_device *dev)