Commit 974c3f19 authored by David S. Miller's avatar David S. Miller

Merge branch 'act_sample-Little-fixes'

Yotam Gigi says:

====================
net/sched: act_sample: Little fixes

Little fixes in sample tc action.
====================
Acked-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 6107dbdb f3b20313
...@@ -76,13 +76,15 @@ static int tcf_sample_init(struct net *net, struct nlattr *nla, ...@@ -76,13 +76,15 @@ static int tcf_sample_init(struct net *net, struct nlattr *nla,
} }
s = to_sample(*a); s = to_sample(*a);
ASSERT_RTNL();
s->tcf_action = parm->action; s->tcf_action = parm->action;
s->rate = nla_get_u32(tb[TCA_SAMPLE_RATE]); s->rate = nla_get_u32(tb[TCA_SAMPLE_RATE]);
s->psample_group_num = nla_get_u32(tb[TCA_SAMPLE_PSAMPLE_GROUP]); s->psample_group_num = nla_get_u32(tb[TCA_SAMPLE_PSAMPLE_GROUP]);
psample_group = psample_group_get(net, s->psample_group_num); 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; return -ENOMEM;
}
RCU_INIT_POINTER(s->psample_group, psample_group); RCU_INIT_POINTER(s->psample_group, psample_group);
if (tb[TCA_SAMPLE_TRUNC_SIZE]) { if (tb[TCA_SAMPLE_TRUNC_SIZE]) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment