summaryrefslogtreecommitdiff
path: root/net/sched
diff options
context:
space:
mode:
authorJiri Pirko <jiri@mellanox.com>2017-08-04 15:29:06 +0300
committerDavid S. Miller <davem@davemloft.net>2017-08-04 21:21:24 +0300
commit455075292b0d58f708c1afe7011a8b9223b2c9c8 (patch)
tree1e7d823242ae5e44249478ef571f865ff35faab0 /net/sched
parent1e5003af37352f37ba008f99014cc47c684ae808 (diff)
downloadlinux-455075292b0d58f708c1afe7011a8b9223b2c9c8.tar.xz
net: sched: cls_flower: no need to call tcf_exts_change for newly allocated struct
As the f struct was allocated right before fl_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>
Diffstat (limited to 'net/sched')
-rw-r--r--net/sched/cls_flower.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c
index 7832eb93379b..7ab524fc43f9 100644
--- a/net/sched/cls_flower.c
+++ b/net/sched/cls_flower.c
@@ -852,15 +852,11 @@ static int fl_set_parms(struct net *net, struct tcf_proto *tp,
unsigned long base, struct nlattr **tb,
struct nlattr *est, bool ovr)
{
- struct tcf_exts e;
int err;
- err = tcf_exts_init(&e, TCA_FLOWER_ACT, 0);
+ err = tcf_exts_validate(net, tp, tb, est, &f->exts, ovr);
if (err < 0)
return err;
- err = tcf_exts_validate(net, tp, tb, est, &e, ovr);
- if (err < 0)
- goto errout;
if (tb[TCA_FLOWER_CLASSID]) {
f->res.classid = nla_get_u32(tb[TCA_FLOWER_CLASSID]);
@@ -869,17 +865,12 @@ static int fl_set_parms(struct net *net, struct tcf_proto *tp,
err = fl_set_key(net, tb, &f->key, &mask->key);
if (err)
- goto errout;
+ return err;
fl_mask_update_range(mask);
fl_set_masked_key(&f->mkey, &f->key, mask);
- tcf_exts_change(tp, &f->exts, &e);
-
return 0;
-errout:
- tcf_exts_destroy(&e);
- return err;
}
static u32 fl_grab_new_handle(struct tcf_proto *tp,