Replace call_rcu() with synchronize_rcu().

Reported-by: Chris Mi <chr...@mellanox.com>
Cc: Daniel Borkmann <dan...@iogearbox.net>
Cc: Jiri Pirko <j...@resnulli.us>
Cc: John Fastabend <john.fastab...@gmail.com>
Cc: Jamal Hadi Salim <j...@mojatatu.com>
Cc: "Paul E. McKenney" <paul...@linux.vnet.ibm.com>
Signed-off-by: Cong Wang <xiyou.wangc...@gmail.com>
---
 net/sched/cls_matchall.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/net/sched/cls_matchall.c b/net/sched/cls_matchall.c
index eeac606c95ab..459614cf4186 100644
--- a/net/sched/cls_matchall.c
+++ b/net/sched/cls_matchall.c
@@ -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)
-- 
2.13.0

Reply via email to