Skip to content

Commit a74cb36

Browse files
jpirkodavem330
authored andcommitted
net: sched: cls_matchall: no need to call tcf_exts_change for newly allocated struct
As the head struct was allocated right before mall_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 94611bf commit a74cb36

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

net/sched/cls_matchall.c

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -120,27 +120,17 @@ static int mall_set_parms(struct net *net, struct tcf_proto *tp,
120120
unsigned long base, struct nlattr **tb,
121121
struct nlattr *est, bool ovr)
122122
{
123-
struct tcf_exts e;
124123
int err;
125124

126-
err = tcf_exts_init(&e, TCA_MATCHALL_ACT, 0);
127-
if (err)
128-
return err;
129-
err = tcf_exts_validate(net, tp, tb, est, &e, ovr);
125+
err = tcf_exts_validate(net, tp, tb, est, &head->exts, ovr);
130126
if (err < 0)
131-
goto errout;
127+
return err;
132128

133129
if (tb[TCA_MATCHALL_CLASSID]) {
134130
head->res.classid = nla_get_u32(tb[TCA_MATCHALL_CLASSID]);
135131
tcf_bind_filter(tp, &head->res, base);
136132
}
137-
138-
tcf_exts_change(tp, &head->exts, &e);
139-
140133
return 0;
141-
errout:
142-
tcf_exts_destroy(&e);
143-
return err;
144134
}
145135

146136
static int mall_change(struct net *net, struct sk_buff *in_skb,

0 commit comments

Comments
 (0)