diff options
author | Denis V. Lunev <den@openvz.org> | 2008-01-15 01:59:30 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:02:09 -0500 |
commit | 72132c1b6c7a7605cdfde86a9f58b6ca2b2195a6 (patch) | |
tree | 35b13af8135ad136800f39b9a7aff40082123878 | |
parent | 2db82b534bd52b349f1b2ab3e63aa40ca0e466ab (diff) |
[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: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/net/fib_rules.h | 2 | ||||
-rw-r--r-- | net/core/fib_rules.c | 21 |
2 files changed, 5 insertions, 18 deletions
diff --git a/include/net/fib_rules.h b/include/net/fib_rules.h index e9a074cf59..4f47250712 100644 --- a/include/net/fib_rules.h +++ b/include/net/fib_rules.h | |||
@@ -102,7 +102,7 @@ static inline u32 frh_get_table(struct fib_rule_hdr *frh, struct nlattr **nla) | |||
102 | } | 102 | } |
103 | 103 | ||
104 | extern int fib_rules_register(struct net *, struct fib_rules_ops *); | 104 | extern int fib_rules_register(struct net *, struct fib_rules_ops *); |
105 | extern int fib_rules_unregister(struct net *, struct fib_rules_ops *); | 105 | extern void fib_rules_unregister(struct net *, struct fib_rules_ops *); |
106 | extern void fib_rules_cleanup_ops(struct fib_rules_ops *); | 106 | extern void fib_rules_cleanup_ops(struct fib_rules_ops *); |
107 | 107 | ||
108 | extern int fib_rules_lookup(struct fib_rules_ops *, | 108 | extern int fib_rules_lookup(struct fib_rules_ops *, |
diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c index c5f78fed68..541728aa2b 100644 --- a/net/core/fib_rules.c +++ b/net/core/fib_rules.c | |||
@@ -112,29 +112,16 @@ void fib_rules_cleanup_ops(struct fib_rules_ops *ops) | |||
112 | } | 112 | } |
113 | EXPORT_SYMBOL_GPL(fib_rules_cleanup_ops); | 113 | EXPORT_SYMBOL_GPL(fib_rules_cleanup_ops); |
114 | 114 | ||
115 | int fib_rules_unregister(struct net *net, struct fib_rules_ops *ops) | 115 | void fib_rules_unregister(struct net *net, struct fib_rules_ops *ops) |
116 | { | 116 | { |
117 | int err = 0; | ||
118 | struct fib_rules_ops *o; | ||
119 | 117 | ||
120 | spin_lock(&net->rules_mod_lock); | 118 | spin_lock(&net->rules_mod_lock); |
121 | list_for_each_entry(o, &net->rules_ops, list) { | 119 | list_del_rcu(&ops->list); |
122 | if (o == ops) { | 120 | fib_rules_cleanup_ops(ops); |
123 | list_del_rcu(&o->list); | ||
124 | fib_rules_cleanup_ops(ops); | ||
125 | goto out; | ||
126 | } | ||
127 | } | ||
128 | |||
129 | err = -ENOENT; | ||
130 | out: | ||
131 | spin_unlock(&net->rules_mod_lock); | 121 | spin_unlock(&net->rules_mod_lock); |
132 | 122 | ||
133 | synchronize_rcu(); | 123 | synchronize_rcu(); |
134 | if (!err) | 124 | release_net(net); |
135 | release_net(net); | ||
136 | |||
137 | return err; | ||
138 | } | 125 | } |
139 | 126 | ||
140 | EXPORT_SYMBOL_GPL(fib_rules_unregister); | 127 | EXPORT_SYMBOL_GPL(fib_rules_unregister); |