From: John Fastabend Date: Mon, 6 Oct 2014 04:28:20 +0000 (-0700) Subject: net: sched: cls_cgroup tear down exts and ematch from rcu callback X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=13990f8156862fe945a1a226850a6550c8988a33;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git net: sched: cls_cgroup tear down exts and ematch from rcu callback It is not RCU safe to destroy the action chain while there is a possibility of readers accessing it. Move this code into the rcu callback using the same rcu callback used in the code patch to make a change to head. Signed-off-by: John Fastabend Acked-by: Cong Wang Signed-off-by: David S. Miller --- diff --git a/net/sched/cls_cgroup.c b/net/sched/cls_cgroup.c index 2f77a89655dc..d61a801222c1 100644 --- a/net/sched/cls_cgroup.c +++ b/net/sched/cls_cgroup.c @@ -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(&head->exts); - tcf_em_tree_destroy(&head->ematches); RCU_INIT_POINTER(tp->root, NULL); - kfree_rcu(head, rcu); + call_rcu(&head->rcu, cls_cgroup_destroy_rcu); } }