]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[IPV4]: fib_rules_unregister is essentially void.
authorDenis V. Lunev <den@openvz.org>
Tue, 15 Jan 2008 06:59:30 +0000 (22:59 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jan 2008 23:02:09 +0000 (15:02 -0800)
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>
include/net/fib_rules.h
net/core/fib_rules.c

index e9a074cf59edffc20d52372238d58c8d6051ced7..4f472507129e6b69b5a2beb7b95ebca6f6d494a8 100644 (file)
@@ -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 *,
index c5f78fed6885b25ea428f49306f2b840b32e0245..541728aa2baeaa22e2348907ee5b203fb2a1d962 100644 (file)
@@ -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);
-                       fib_rules_cleanup_ops(ops);
-                       goto out;
-               }
-       }
-
-       err = -ENOENT;
-out:
+       list_del_rcu(&ops->list);
+       fib_rules_cleanup_ops(ops);
        spin_unlock(&net->rules_mod_lock);
 
        synchronize_rcu();
-       if (!err)
-               release_net(net);
-
-       return err;
+       release_net(net);
 }
 
 EXPORT_SYMBOL_GPL(fib_rules_unregister);