Commit 8258d2da authored by Paul Blakey's avatar Paul Blakey Committed by David S. Miller
Browse files

cls_flower: Fix incorrect idr release when failing to modify rule

When we fail to modify a rule, we incorrectly release the idr handle
of the unmodified old rule.

Fix that by checking if we need to release it.

Fixes: fe2502e4

 ("net_sched: remove cls_flower idr on failure")
Reported-by: default avatarVlad Buslov <>
Reviewed-by: default avatarRoi Dayan <>
Acked-by: default avatarJiri Pirko <>
Signed-off-by: default avatarPaul Blakey <>
Signed-off-by: default avatarDavid S. Miller <>
parent 26de0b76
......@@ -977,7 +977,7 @@ static int fl_change(struct net *net, struct sk_buff *in_skb,
return 0;
if (fnew->handle)
if (!fold)
idr_remove(&head->handle_idr, fnew->handle);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment