cls_flower: Fix incorrect idr release when failing to modify rule
authorPaul Blakey <paulb@mellanox.com>
Wed, 30 May 2018 08:29:15 +0000 (11:29 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 11 Jun 2018 20:49:22 +0000 (22:49 +0200)
commitdd4be396b8c5d926775f664a6b2aad0509fa6cc3
tree6fafcd90f74ae9b7f837a6a2821f275f6f850bb6
parentc931c9aee2f36f6b7e52b5ba5e35b033d7e0233b
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: fe2502e49b58 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/sched/cls_flower.c