Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dd4be396 authored by Paul Blakey's avatar Paul Blakey Committed by Greg Kroah-Hartman
Browse files

cls_flower: Fix incorrect idr release when failing to modify rule



[ Upstream commit 8258d2da9f9f521dce7019e018360c28d116354e ]

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 <vladbu@mellanox.com>
Reviewed-by: default avatarRoi Dayan <roid@mellanox.com>
Acked-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarPaul Blakey <paulb@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c931c9ae
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1007,7 +1007,7 @@ static int fl_change(struct net *net, struct sk_buff *in_skb,
	return 0;

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