mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-23 20:53:53 +08:00
act_ipt: fix a bind refcnt leak
And avoid calling tcf_hash_check() twice.
Fixes: a57f19d30b
("net sched: ipt action fix late binding")
Cc: Jamal Hadi Salim <jhs@mojatatu.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>
This commit is contained in:
parent
3d7c8257d9
commit
d15eccea69
@ -121,10 +121,13 @@ static int __tcf_ipt_init(struct tc_action_net *tn, struct nlattr *nla,
|
|||||||
}
|
}
|
||||||
|
|
||||||
td = (struct xt_entry_target *)nla_data(tb[TCA_IPT_TARG]);
|
td = (struct xt_entry_target *)nla_data(tb[TCA_IPT_TARG]);
|
||||||
if (nla_len(tb[TCA_IPT_TARG]) < td->u.target_size)
|
if (nla_len(tb[TCA_IPT_TARG]) < td->u.target_size) {
|
||||||
|
if (exists)
|
||||||
|
tcf_hash_release(a, bind);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
if (!tcf_hash_check(tn, index, a, bind)) {
|
if (!exists) {
|
||||||
ret = tcf_hash_create(tn, index, est, a, sizeof(*ipt), bind,
|
ret = tcf_hash_create(tn, index, est, a, sizeof(*ipt), bind,
|
||||||
false);
|
false);
|
||||||
if (ret)
|
if (ret)
|
||||||
|
Loading…
Reference in New Issue
Block a user