projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3d7c825
)
act_ipt: fix a bind refcnt leak
author
WANG Cong
<
[email protected]
>
Mon, 13 Jun 2016 20:44:14 +0000
(13:44 -0700)
committer
David S. Miller
<
[email protected]
>
Wed, 15 Jun 2016 19:31:35 +0000
(12:31 -0700)
And avoid calling tcf_hash_check() twice.
Fixes: a57f19d30b2d ("net sched: ipt action fix late binding")
Cc: Jamal Hadi Salim <
[email protected]
>
Signed-off-by: Cong Wang <
[email protected]
>
Acked-by: Jamal Hadi Salim <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
net/sched/act_ipt.c
patch
|
blob
|
history
diff --git
a/net/sched/act_ipt.c
b/net/sched/act_ipt.c
index 9f002ada7074ccdb648433b443870562962c8694..d4bd19ee5822d4849cbf6c473d3245fb2cbff094 100644
(file)
--- a/
net/sched/act_ipt.c
+++ b/
net/sched/act_ipt.c
@@
-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]);
- 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;
+ }
- if (!
tcf_hash_check(tn, index, a, bind)
) {
+ if (!
exists
) {
ret = tcf_hash_create(tn, index, est, a, sizeof(*ipt), bind,
false);
if (ret)