]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
pkt_sched: Fix actions referencing
authorJamal Hadi Salim <hadi@cyberus.ca>
Thu, 28 Aug 2008 05:38:11 +0000 (22:38 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 8 Sep 2008 11:44:24 +0000 (04:44 -0700)
[ Upstream commit 76aab2c1eae491a5d73ac83deec97dd28ebac584 ]

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: Jamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
net/sched/act_api.c

index 74e662cbb2c5b7a61a1c0815a358899c6abc694a..b5e116c28e727b6618e89cd301fc89466351c421 100644 (file)
@@ -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;