--- a/net-next/net/sched/cls_u32.c 2018-10-09 05:18:04.046642676 -0400 +++ b/net/sched/cls_u32.c 2018-10-09 05:29:51.965528032 -0400 @@ -391,6 +391,7 @@ RCU_INIT_POINTER(root_ht->next, tp_c->hlist); rcu_assign_pointer(tp_c->hlist, root_ht); + root_ht->refcnt++; rcu_assign_pointer(tp->root, root_ht); tp->data = tp_c; return 0; @@ -606,7 +607,7 @@ struct tc_u_hnode __rcu **hn; struct tc_u_hnode *phn; - WARN_ON(ht->refcnt); + WARN_ON(--ht->refcnt); u32_clear_hnode(tp, ht, extack); @@ -634,7 +635,7 @@ WARN_ON(root_ht == NULL); - if (root_ht && --root_ht->refcnt == 0) + if (root_ht && --root_ht->refcnt == 1) u32_destroy_hnode(tp, root_ht, extack); if (--tp_c->refcnt == 0) { @@ -679,7 +680,6 @@ } if (ht->refcnt == 1) { - ht->refcnt--; u32_destroy_hnode(tp, ht, extack); } else { NL_SET_ERR_MSG_MOD(extack, "Can not delete in-use filter"); @@ -1079,8 +1079,7 @@ } #endif - err = u32_set_parms(net, tp, base, n, tb, tca[TCA_RATE], ovr, - extack); + err = u32_set_parms(net, tp, base, n, tb, tca[TCA_RATE], ovr, extack); if (err == 0) { struct tc_u_knode __rcu **ins; struct tc_u_knode *pins;