diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c index cab9e9b..ac5e0ad 100644 --- a/net/sched/cls_u32.c +++ b/net/sched/cls_u32.c @@ -495,6 +495,20 @@ static bool u32_destroy(struct tcf_proto *tp, bool force) if (root_ht && --root_ht->refcnt == 0) u32_destroy_hnode(tp, root_ht); + if (!force) { + struct tc_u_hnode *ht; + + if (tp_c->refcnt > 1) + return false; + if (tp_c->refcnt == 1) { + for (ht = rtnl_dereference(tp_c->hlist); + ht; + ht = rtnl_dereference(ht->next)) + if (!ht_empty(ht)) + return false; + } + } + if (--tp_c->refcnt == 0) { struct tc_u_hnode *ht;