Skip to content

Commit ff1f8ca

Browse files
jpirkodavem330
authored andcommitted
net: sched: cls_basic: no need to call tcf_exts_change for newly allocated struct
As the f struct was allocated right before basic_set_parms call, no need to use tcf_exts_change to do atomic change, and we can just fill-up the unused exts struct directly by tcf_exts_validate. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent a74cb36 commit ff1f8ca

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

net/sched/cls_basic.c

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -129,31 +129,22 @@ static int basic_set_parms(struct net *net, struct tcf_proto *tp,
129129
struct nlattr *est, bool ovr)
130130
{
131131
int err;
132-
struct tcf_exts e;
133132

134-
err = tcf_exts_init(&e, TCA_BASIC_ACT, TCA_BASIC_POLICE);
133+
err = tcf_exts_validate(net, tp, tb, est, &f->exts, ovr);
135134
if (err < 0)
136135
return err;
137-
err = tcf_exts_validate(net, tp, tb, est, &e, ovr);
138-
if (err < 0)
139-
goto errout;
140136

141137
err = tcf_em_tree_validate(tp, tb[TCA_BASIC_EMATCHES], &f->ematches);
142138
if (err < 0)
143-
goto errout;
139+
return err;
144140

145141
if (tb[TCA_BASIC_CLASSID]) {
146142
f->res.classid = nla_get_u32(tb[TCA_BASIC_CLASSID]);
147143
tcf_bind_filter(tp, &f->res, base);
148144
}
149145

150-
tcf_exts_change(tp, &f->exts, &e);
151146
f->tp = tp;
152-
153147
return 0;
154-
errout:
155-
tcf_exts_destroy(&e);
156-
return err;
157148
}
158149

159150
static int basic_change(struct net *net, struct sk_buff *in_skb,

0 commit comments

Comments
 (0)