cls_flower: Fix incorrect idr release when failing to modify rule
authorPaul Blakey <[email protected]>
Wed, 30 May 2018 08:29:15 +0000 (11:29 +0300)
committerDavid S. Miller <[email protected]>
Thu, 31 May 2018 19:18:44 +0000 (15:18 -0400)
commit8258d2da9f9f521dce7019e018360c28d116354e
tree7b7e7a59b441da96e0f7b10bb281006d85a76ded
parent26de0b76d9ba3200f09c6cb9d9618bda338be5f7
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: fe2502e49b58 ("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]>
net/sched/cls_flower.c