act_mirred: always release tcf hash
authorWANG Cong <xiyou.wangcong@gmail.com>
Thu, 1 Oct 2015 18:37:43 +0000 (11:37 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 5 Oct 2015 13:30:34 +0000 (06:30 -0700)
Align with other tc actions.

Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Cong Wang <cwang@twopensource.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/act_mirred.c

index 3e7c51a8ca382bd87bbf895f11d34defbbc96dfb..2efaf4ee60408ce663c53378eea51ae7206d72ef 100644 (file)
@@ -107,10 +107,10 @@ static int tcf_mirred_init(struct net *net, struct nlattr *nla,
        } else {
                if (bind)
                        return 0;
-               if (!ovr) {
-                       tcf_hash_release(a, bind);
+
+               tcf_hash_release(a, bind);
+               if (!ovr)
                        return -EEXIST;
-               }
        }
        m = to_mirred(a);