Skip to content

Commit f12c643

Browse files
congwangdavem330
authored andcommitted
net_sched: fix a missing idr_remove() in u32_delete_key()
When we delete a u32 key via u32_delete_key(), we forget to call idr_remove() to remove its handle from IDR. Fixes: e761437 ("net_sched: use idr to allocate u32 filter handles") Reported-by: Marcin Kabiesz <[email protected]> Tested-by: Marcin Kabiesz <[email protected]> Signed-off-by: Cong Wang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent dd9a122 commit f12c643

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

net/sched/cls_u32.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,7 @@ static int u32_delete_key(struct tcf_proto *tp, struct tc_u_knode *key)
489489
RCU_INIT_POINTER(*kp, key->next);
490490

491491
tcf_unbind_filter(tp, &key->res);
492+
idr_remove(&ht->handle_idr, key->handle);
492493
tcf_exts_get_net(&key->exts);
493494
call_rcu(&key->rcu, u32_delete_key_freepf_rcu);
494495
return 0;

0 commit comments

Comments
 (0)