Skip to content

Commit

Permalink
act_mirred: avoid calling tcf_hash_release() when binding
Browse files Browse the repository at this point in the history
When we share an action within a filter, the bind refcnt
should increase, therefore we should not call tcf_hash_release().

Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Cong Wang <cwang@twopensource.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
WANG Cong authored and David S. Miller committed Aug 3, 2015
1 parent 3576fd7 commit 636dba8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/sched/act_mirred.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ static int tcf_mirred_init(struct net *net, struct nlattr *nla,
return ret;
ret = ACT_P_CREATED;
} else {
if (bind)
return 0;
if (!ovr) {
tcf_hash_release(a, bind);
return -EEXIST;
Expand Down

0 comments on commit 636dba8

Please sign in to comment.