diff options
author | Paul Blakey <paulb@mellanox.com> | 2018-05-30 11:29:15 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-06-11 22:49:22 +0200 |
commit | dd4be396b8c5d926775f664a6b2aad0509fa6cc3 (patch) | |
tree | 6fafcd90f74ae9b7f837a6a2821f275f6f850bb6 | |
parent | c931c9aee2f36f6b7e52b5ba5e35b033d7e0233b (diff) | |
download | linux-stable-dd4be396b8c5d926775f664a6b2aad0509fa6cc3.tar.gz linux-stable-dd4be396b8c5d926775f664a6b2aad0509fa6cc3.tar.bz2 linux-stable-dd4be396b8c5d926775f664a6b2aad0509fa6cc3.zip |
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>
-rw-r--r-- | net/sched/cls_flower.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c index 7a838d1c1c00..1879665e5a2b 100644 --- a/net/sched/cls_flower.c +++ b/net/sched/cls_flower.c @@ -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); |