Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=72132c1b6c7a7605cdfde86a9f58b6ca2b2195a6
Commit:     72132c1b6c7a7605cdfde86a9f58b6ca2b2195a6
Parent:     2db82b534bd52b349f1b2ab3e63aa40ca0e466ab
Author:     Denis V. Lunev <[EMAIL PROTECTED]>
AuthorDate: Mon Jan 14 22:59:30 2008 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Jan 28 15:02:09 2008 -0800

    [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 <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 include/net/fib_rules.h |    2 +-
 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 e9a074c..4f47250 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)
 }
 
 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 *,
diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c
index c5f78fe..541728a 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)
 }
 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);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to