Commit 4cd12f88 authored by Jamal Hadi Salim's avatar Jamal Hadi Salim Committed by Greg Kroah-Hartman

pkt_sched: Fix actions referencing

[ Upstream commit 76aab2c1 ]

When an action is added several times with the same exact index
it gets deleted on every even-numbered attempt.
This fixes that issue.
Signed-off-by: default avatarJamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 685f605a
......@@ -205,10 +205,9 @@ struct tcf_common *tcf_hash_check(u32 index, struct tc_action *a, int bind,
{
struct tcf_common *p = NULL;
if (index && (p = tcf_hash_lookup(index, hinfo)) != NULL) {
if (bind) {
if (bind)
p->tcfc_bindcnt++;
p->tcfc_refcnt++;
}
p->tcfc_refcnt++;
a->priv = p;
}
return p;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment