diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c index 205c194bdca06939bed961733c3b0ca09dafc6a9..23d95db99121378fb349d99dd7f0c4b1ab4680ed 100644 --- a/net/sched/cls_u32.c +++ b/net/sched/cls_u32.c @@ -877,10 +877,6 @@ static struct tc_u_knode *u32_init_knode(struct tcf_proto *tp, new->flags = n->flags; RCU_INIT_POINTER(new->ht_down, ht); - /* bump reference count as long as we hold pointer to structure */ - if (ht) - ht->refcnt++; - #ifdef CONFIG_CLS_U32_PERF /* Statistics may be incremented by readers during update * so we must keep them in tact. When the node is later destroyed @@ -903,6 +899,10 @@ static struct tc_u_knode *u32_init_knode(struct tcf_proto *tp, return NULL; } + /* bump reference count as long as we hold pointer to structure */ + if (ht) + ht->refcnt++; + return new; }