summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2017-02-01 14:10:04 -0500
committerDavid S. Miller <davem@davemloft.net>2017-02-01 14:10:04 -0500
commit974c3f19acebaa40e391c69056ccf851e40a9c0c (patch)
tree1e4376749b1368e119885639c82edb152d2f2545
parent6107dbdb64465848e310b85ebe589236e24a9680 (diff)
parentf3b20313aef93f9cfda76fec2c05625f88510f18 (diff)
Merge branch 'act_sample-Little-fixes'
Yotam Gigi says: ==================== net/sched: act_sample: Little fixes Little fixes in sample tc action. ==================== Acked-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/sched/act_sample.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/sched/act_sample.c b/net/sched/act_sample.c
index 39229756de07..0b8217b4763f 100644
--- a/net/sched/act_sample.c
+++ b/net/sched/act_sample.c
@@ -76,13 +76,15 @@ static int tcf_sample_init(struct net *net, struct nlattr *nla,
}
s = to_sample(*a);
- ASSERT_RTNL();
s->tcf_action = parm->action;
s->rate = nla_get_u32(tb[TCA_SAMPLE_RATE]);
s->psample_group_num = nla_get_u32(tb[TCA_SAMPLE_PSAMPLE_GROUP]);
psample_group = psample_group_get(net, s->psample_group_num);
- if (!psample_group)
+ if (!psample_group) {
+ if (ret == ACT_P_CREATED)
+ tcf_hash_release(*a, bind);
return -ENOMEM;
+ }
RCU_INIT_POINTER(s->psample_group, psample_group);
if (tb[TCA_SAMPLE_TRUNC_SIZE]) {