cls_matchall: fix tcf_unbind_filter missing
authorHangbin Liu <liuhangbin@gmail.com>
Tue, 14 Aug 2018 09:28:26 +0000 (17:28 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 16 Aug 2018 19:08:26 +0000 (12:08 -0700)
Fix tcf_unbind_filter missing in cls_matchall as this will trigger
WARN_ON() in cbq_destroy_class().

Fixes: fd62d9f5c575f ("net/sched: matchall: Fix configuration race")
Reported-by: Li Shuang <shuali@redhat.com>
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Acked-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/cls_matchall.c

index af16f36ed578910824cac069dad85325e3271e0e..856fa79d4ffd0c86b3b1dfb03952982c42d9593c 100644 (file)
@@ -113,6 +113,8 @@ static void mall_destroy(struct tcf_proto *tp, struct netlink_ext_ack *extack)
        if (!head)
                return;
 
+       tcf_unbind_filter(tp, &head->res);
+
        if (!tc_skip_hw(head->flags))
                mall_destroy_hw_filter(tp, head, (unsigned long) head, extack);