Skip to content

Commit 8258d2d

Browse files
Paul Blakeydavem330
authored andcommitted
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: fe2502e ("net_sched: remove cls_flower idr on failure") Reported-by: Vlad Buslov <[email protected]> Reviewed-by: Roi Dayan <[email protected]> Acked-by: Jiri Pirko <[email protected]> Signed-off-by: Paul Blakey <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 26de0b7 commit 8258d2d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/sched/cls_flower.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,7 @@ static int fl_change(struct net *net, struct sk_buff *in_skb,
977977
return 0;
978978

979979
errout_idr:
980-
if (fnew->handle)
980+
if (!fold)
981981
idr_remove(&head->handle_idr, fnew->handle);
982982
errout:
983983
tcf_exts_destroy(&fnew->exts);

0 commit comments

Comments
 (0)