]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
net/sched/hfsc: allocate tcf block for hfsc root class
authorKonstantin Khlebnikov <khlebnikov@yandex-team.ru>
Thu, 10 Aug 2017 09:31:40 +0000 (12:31 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 11 Aug 2017 21:30:30 +0000 (14:30 -0700)
Without this filters cannot be attached.

Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Fixes: 6529eaba33f0 ("net: sched: introduce tcf block infractructure")
Acked-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_hfsc.c

index b52f74610dc7539fd7804403a6ff41b690243df7..3ad02bbe6903ac3400f088beeb7850de498c06d7 100644 (file)
@@ -1428,6 +1428,10 @@ hfsc_init_qdisc(struct Qdisc *sch, struct nlattr *opt)
                return err;
        q->eligible = RB_ROOT;
 
+       err = tcf_block_get(&q->root.block, &q->root.filter_list);
+       if (err)
+               goto err_tcf;
+
        q->root.cl_common.classid = sch->handle;
        q->root.refcnt  = 1;
        q->root.sched   = q;
@@ -1447,6 +1451,10 @@ hfsc_init_qdisc(struct Qdisc *sch, struct nlattr *opt)
        qdisc_watchdog_init(&q->watchdog, sch);
 
        return 0;
+
+err_tcf:
+       qdisc_class_hash_destroy(&q->clhash);
+       return err;
 }
 
 static int