Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 72132c1b authored by Denis V. Lunev's avatar Denis V. Lunev Committed by David S. Miller
Browse files

[IPV4]: fib_rules_unregister is essentially void.



fib_rules_unregister is called only after successful register and the
return code is never checked.

Signed-off-by: default avatarDenis V. Lunev <den@openvz.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2db82b53
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -102,7 +102,7 @@ static inline u32 frh_get_table(struct fib_rule_hdr *frh, struct nlattr **nla)
}

extern int fib_rules_register(struct net *, struct fib_rules_ops *);
extern int fib_rules_unregister(struct net *, struct fib_rules_ops *);
extern void fib_rules_unregister(struct net *, struct fib_rules_ops *);
extern void                     fib_rules_cleanup_ops(struct fib_rules_ops *);

extern int			fib_rules_lookup(struct fib_rules_ops *,
+4 −17
Original line number Diff line number Diff line
@@ -112,29 +112,16 @@ void fib_rules_cleanup_ops(struct fib_rules_ops *ops)
}
EXPORT_SYMBOL_GPL(fib_rules_cleanup_ops);

int fib_rules_unregister(struct net *net, struct fib_rules_ops *ops)
void fib_rules_unregister(struct net *net, struct fib_rules_ops *ops)
{
	int err = 0;
	struct fib_rules_ops *o;

	spin_lock(&net->rules_mod_lock);
	list_for_each_entry(o, &net->rules_ops, list) {
		if (o == ops) {
			list_del_rcu(&o->list);
	list_del_rcu(&ops->list);
	fib_rules_cleanup_ops(ops);
			goto out;
		}
	}

	err = -ENOENT;
out:
	spin_unlock(&net->rules_mod_lock);

	synchronize_rcu();
	if (!err)
	release_net(net);

	return err;
}

EXPORT_SYMBOL_GPL(fib_rules_unregister);