@@ -21,7 +21,6 @@ struct cls_mall_head {
struct tcf_result res;
u32 handle;
u32 flags;
- struct rcu_head rcu;
};
static int mall_classify(struct sk_buff *skb, const struct tcf_proto *tp,
@@ -41,11 +40,8 @@ static int mall_init(struct tcf_proto *tp)
return 0;
}
-static void mall_destroy_rcu(struct rcu_head *rcu)
+static void __mall_destroy(struct cls_mall_head *head)
{
- struct cls_mall_head *head = container_of(rcu, struct cls_mall_head,
- rcu);
-
tcf_exts_destroy(&head->exts);
kfree(head);
}
@@ -96,7 +92,8 @@ static void mall_destroy(struct tcf_proto *tp)
if (tc_should_offload(dev, head->flags))
mall_destroy_hw_filter(tp, head, (unsigned long) head);
- call_rcu(&head->rcu, mall_destroy_rcu);
+ synchronize_rcu();
+ __mall_destroy(head);
}
static void *mall_get(struct tcf_proto *tp, u32 handle)
Replace call_rcu() with synchronize_rcu(). Reported-by: Chris Mi <chrism@mellanox.com> Cc: Daniel Borkmann <daniel@iogearbox.net> Cc: Jiri Pirko <jiri@resnulli.us> Cc: John Fastabend <john.fastabend@gmail.com> Cc: Jamal Hadi Salim <jhs@mojatatu.com> Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> --- net/sched/cls_matchall.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)