Merge branch 'for-3.18/core' of git://git.kernel.dk/linux-block
[firefly-linux-kernel-4.4.55.git] / net / sched / cls_cgroup.c
index 15c34d4ccd9ee904dc681485871c73ed41735332..d61a801222c10205e339a5d9d622b4ecce804ed4 100644 (file)
@@ -86,8 +86,8 @@ static void cls_cgroup_destroy_rcu(struct rcu_head *root)
                                                    struct cls_cgroup_head,
                                                    rcu);
 
-       tcf_exts_destroy(head->tp, &head->exts);
-       tcf_em_tree_destroy(head->tp, &head->ematches);
+       tcf_exts_destroy(&head->exts);
+       tcf_em_tree_destroy(&head->ematches);
        kfree(head);
 }
 
@@ -135,7 +135,7 @@ static int cls_cgroup_change(struct net *net, struct sk_buff *in_skb,
 
        err = tcf_em_tree_validate(tp, tb[TCA_CGROUP_EMATCHES], &t);
        if (err < 0) {
-               tcf_exts_destroy(tp, &e);
+               tcf_exts_destroy(&e);
                goto errout;
        }
 
@@ -156,10 +156,8 @@ static void cls_cgroup_destroy(struct tcf_proto *tp)
        struct cls_cgroup_head *head = rtnl_dereference(tp->root);
 
        if (head) {
-               tcf_exts_destroy(tp, &head->exts);
-               tcf_em_tree_destroy(tp, &head->ematches);
                RCU_INIT_POINTER(tp->root, NULL);
-               kfree_rcu(head, rcu);
+               call_rcu(&head->rcu, cls_cgroup_destroy_rcu);
        }
 }