Skip to content

Commit a8eab6d

Browse files
congwangdavem330
authored andcommitted
net_sched: fix a missing refcnt in tcindex_init()
The initial refcnt of struct tcindex_data should be 1, it is clear that I forgot to set it to 1 in tcindex_init(). This leads to a dec-after-zero warning. Reported-by: [email protected] Fixes: 304e024 ("net_sched: add a temporary refcnt for struct tcindex_data") Cc: Jamal Hadi Salim <[email protected]> Cc: Jiri Pirko <[email protected]> Cc: Paul E. McKenney <[email protected]> Signed-off-by: Cong Wang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 3e1221a commit a8eab6d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

net/sched/cls_tcindex.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ static int tcindex_init(struct tcf_proto *tp)
151151
p->mask = 0xffff;
152152
p->hash = DEFAULT_HASH_SIZE;
153153
p->fall_through = 1;
154+
refcount_set(&p->refcnt, 1); /* Paired with tcindex_destroy_work() */
154155

155156
rcu_assign_pointer(tp->root, p);
156157
return 0;

0 commit comments

Comments
 (0)