net: sched: cls_cgroup need tcf_exts_init in all cases
authorJohn Fastabend <john.fastabend@gmail.com>
Tue, 16 Sep 2014 07:33:42 +0000 (00:33 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 16 Sep 2014 20:26:39 +0000 (16:26 -0400)
This ensures the tcf_exts_init() is called for all cases.

Fixes: 952313bd62589cae216a57 ("net: sched: cls_cgroup use RCU")
Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Acked-by: Cong Wang <cwang@twopensource.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/cls_cgroup.c

index 10c7ffde13e22d0fefe308fd2fa9adfb753a97ee..15c34d4ccd9ee904dc681485871c73ed41735332 100644 (file)
@@ -116,12 +116,11 @@ static int cls_cgroup_change(struct net *net, struct sk_buff *in_skb,
        if (!new)
                return -ENOBUFS;
 
-       if (head) {
+       tcf_exts_init(&new->exts, TCA_CGROUP_ACT, TCA_CGROUP_POLICE);
+       if (head)
                new->handle = head->handle;
-       } else {
-               tcf_exts_init(&new->exts, TCA_CGROUP_ACT, TCA_CGROUP_POLICE);
+       else
                new->handle = handle;
-       }
 
        new->tp = tp;
        err = nla_parse_nested(tb, TCA_CGROUP_MAX, tca[TCA_OPTIONS],