Skip to contentSkip to conversation

net_sched: fix a missing idr_remove() in u32_delete_key()

PATCH In review Cong Wang 2 participants 2 messages Apr 7, 2018

Subsystems (3)
lore
Share & tools
lore

Cong Wang

author
#0 lore raw

PATCH 1/1 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 e7614370d6f0 ("net_sched: use idr to allocate u32 filter handles")
Cc Linus Torvalds <[email protected]>
Cc Jamal Hadi Salim <[email protected]>
---
 net/sched/cls_u32.c | 1 +
 1 file changed, 1 insertion(+)
net/sched/cls_u32.c +1 -0
index ed8b6a24b9e9..bac47b5d18fd 100644
@@ -489,6 +489,7 @@ static int u32_delete_key(struct tcf_proto *tp, struct tc_u_knode *key)
 				RCU_INIT_POINTER(*kp, key->next);
 
 				tcf_unbind_filter(tp, &key->res);
+				idr_remove(&ht->handle_idr, key->handle);
 				tcf_exts_get_net(&key->exts);
 				call_rcu(&key->rcu, u32_delete_key_freepf_rcu);
 				return 0;
Signature · 1 line
2.13.0
#1 lore raw
Quoted 5 lines · Cong Wang

When we delete a u32 key via u32_delete_key(), we forget to call idr_remove() to remove its handle from IDR.

Fixes e7614370d6f0 ("net_sched: use idr to allocate u32 filter handles")

Marcin sent me a tested-by too, so this seems all good.

Thanks,

Linus