summaryrefslogtreecommitdiffstats
path: root/kernel/net/sched/cls_u32.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/net/sched/cls_u32.c')
-rw-r--r--kernel/net/sched/cls_u32.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/kernel/net/sched/cls_u32.c b/kernel/net/sched/cls_u32.c
index cab9e9b43..4fbb67430 100644
--- a/kernel/net/sched/cls_u32.c
+++ b/kernel/net/sched/cls_u32.c
@@ -490,6 +490,19 @@ static bool u32_destroy(struct tcf_proto *tp, bool force)
return false;
}
}
+
+ if (tp_c->refcnt > 1)
+ return false;
+
+ if (tp_c->refcnt == 1) {
+ struct tc_u_hnode *ht;
+
+ for (ht = rtnl_dereference(tp_c->hlist);
+ ht;
+ ht = rtnl_dereference(ht->next))
+ if (!ht_empty(ht))
+ return false;
+ }
}
if (root_ht && --root_ht->refcnt == 0)