Skip to content

Commit

Permalink
cls_flower: Fix incorrect idr release when failing to modify rule
Browse files Browse the repository at this point in the history
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: fe2502e ("net_sched: remove cls_flower idr on failure")
Reported-by: Vlad Buslov <vladbu@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Paul Blakey <paulb@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Paul Blakey authored and David S. Miller committed May 31, 2018
1 parent 26de0b7 commit 8258d2d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/sched/cls_flower.c
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@ static int fl_change(struct net *net, struct sk_buff *in_skb,
return 0;

errout_idr:
if (fnew->handle)
if (!fold)
idr_remove(&head->handle_idr, fnew->handle);
errout:
tcf_exts_destroy(&fnew->exts);
Expand Down

0 comments on commit 8258d2d

Please sign in to comment.