Merge tag 'rpmsg-3.19-next' of git://git.kernel.org/pub/scm/linux/kernel/git/ohad...
[deliverable/linux.git] / net / sched / cls_basic.c
index cd61280941e5c72d8c22e4dfe18ec517e90cba53..5aed341406c2366ed5c7b50c54f113e21bd27fde 100644 (file)
@@ -72,10 +72,6 @@ static unsigned long basic_get(struct tcf_proto *tp, u32 handle)
        return l;
 }
 
-static void basic_put(struct tcf_proto *tp, unsigned long f)
-{
-}
-
 static int basic_init(struct tcf_proto *tp)
 {
        struct basic_head *head;
@@ -113,18 +109,12 @@ static void basic_destroy(struct tcf_proto *tp)
 
 static int basic_delete(struct tcf_proto *tp, unsigned long arg)
 {
-       struct basic_head *head = rtnl_dereference(tp->root);
-       struct basic_filter *t, *f = (struct basic_filter *) arg;
-
-       list_for_each_entry(t, &head->flist, link)
-               if (t == f) {
-                       list_del_rcu(&t->link);
-                       tcf_unbind_filter(tp, &t->res);
-                       call_rcu(&t->rcu, basic_delete_filter);
-                       return 0;
-               }
+       struct basic_filter *f = (struct basic_filter *) arg;
 
-       return -ENOENT;
+       list_del_rcu(&f->link);
+       tcf_unbind_filter(tp, &f->res);
+       call_rcu(&f->rcu, basic_delete_filter);
+       return 0;
 }
 
 static const struct nla_policy basic_policy[TCA_BASIC_MAX + 1] = {
@@ -188,10 +178,9 @@ static int basic_change(struct net *net, struct sk_buff *in_skb,
                        return -EINVAL;
        }
 
-       err = -ENOBUFS;
        fnew = kzalloc(sizeof(*fnew), GFP_KERNEL);
-       if (fnew == NULL)
-               goto errout;
+       if (!fnew)
+               return -ENOBUFS;
 
        tcf_exts_init(&fnew->exts, TCA_BASIC_ACT, TCA_BASIC_POLICE);
        err = -EINVAL;
@@ -293,7 +282,6 @@ static struct tcf_proto_ops cls_basic_ops __read_mostly = {
        .init           =       basic_init,
        .destroy        =       basic_destroy,
        .get            =       basic_get,
-       .put            =       basic_put,
        .change         =       basic_change,
        .delete         =       basic_delete,
        .walk           =       basic_walk,
This page took 0.029858 seconds and 5 git commands to generate.