[PATCH 4.16 17/18] net_sched: fix a missing idr_remove() in u32_delete_key()
4.16-stable review patch. If anyone has any objections, please let me know. -- From: Cong Wang[ Upstream commit f12c643209db0626f2f54780d86bb93bfa7a9c2d ] 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") Reported-by: Marcin Kabiesz Tested-by: Marcin Kabiesz Signed-off-by: Cong Wang Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/sched/cls_u32.c |1 + 1 file changed, 1 insertion(+) --- a/net/sched/cls_u32.c +++ b/net/sched/cls_u32.c @@ -489,6 +489,7 @@ static int u32_delete_key(struct tcf_pro RCU_INIT_POINTER(*kp, key->next); tcf_unbind_filter(tp, >res); + idr_remove(>handle_idr, key->handle); tcf_exts_get_net(>exts); call_rcu(>rcu, u32_delete_key_freepf_rcu); return 0;
[PATCH 4.16 17/18] net_sched: fix a missing idr_remove() in u32_delete_key()
4.16-stable review patch. If anyone has any objections, please let me know. -- From: Cong Wang [ Upstream commit f12c643209db0626f2f54780d86bb93bfa7a9c2d ] 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") Reported-by: Marcin Kabiesz Tested-by: Marcin Kabiesz Signed-off-by: Cong Wang Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/sched/cls_u32.c |1 + 1 file changed, 1 insertion(+) --- a/net/sched/cls_u32.c +++ b/net/sched/cls_u32.c @@ -489,6 +489,7 @@ static int u32_delete_key(struct tcf_pro RCU_INIT_POINTER(*kp, key->next); tcf_unbind_filter(tp, >res); + idr_remove(>handle_idr, key->handle); tcf_exts_get_net(>exts); call_rcu(>rcu, u32_delete_key_freepf_rcu); return 0;