Skip to content

Commit

Permalink
act_pedit: check binding before calling tcf_hash_release()
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().

Fixes: 1a29321 ("net_sched: act: Dont increment refcnt on replace")
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>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
WANG Cong authored and David S. Miller committed Jul 31, 2015
1 parent 8a68173 commit 5175f71
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions net/sched/act_pedit.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,12 @@ static int tcf_pedit_init(struct net *net, struct nlattr *nla,
}
ret = ACT_P_CREATED;
} else {
p = to_pedit(a);
tcf_hash_release(a, bind);
if (bind)
return 0;
tcf_hash_release(a, bind);
if (!ovr)
return -EEXIST;

p = to_pedit(a);
if (p->tcfp_nkeys && p->tcfp_nkeys != parm->nkeys) {
keys = kmalloc(ksize, GFP_KERNEL);
if (keys == NULL)
Expand Down

0 comments on commit 5175f71

Please sign in to comment.