mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-29 10:34:22 -04:00
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>
This commit is contained in:
committed by
David S. Miller
parent
6ef1ca2d14
commit
41aa426392
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user