net: sched: cbq: create block for q->link.block
Subsystems (3)
Jiri Pirko
maintainerPATCH 1/1 net: sched: cbq: create block for q->link.block
From: Jiri Pirko <[email protected]>
q->link.block is not initialized, that leads to EINVAL when one tries to add filter there. So initialize it properly.
This can be reproduced by:
Reported-by Jaroslav Aster <[email protected]>
Reported-by Ivan Vecera <[email protected]>
Fixes 6529eaba33f0 ("net: sched: introduce tcf block infractructure")
Signed-off-by Jiri Pirko <[email protected]>
--- net/sched/sch_cbq.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
net/sched/sch_cbq.c +8 -1
@@ -1158,9 +1158,13 @@ static int cbq_init(struct Qdisc *sch, struct nlattr *opt)if ((q->link.R_tab =qdisc_get_rtab (r, tb[TCA_CBQ_RTAB ])) ==NULL )return -EINVAL ; + err =tcf_block_get (&q->link.block, &q->link.filter_list, sch); +if (err) + goto put_rtab; + err =qdisc_class_hash_init (&q->clhash);if (err <0 ) - goto put_rtab; + goto put_block; q->link.sibling = &q->link; q->link.common.classid = sch->handle;
@@ -1194,6 +1198,9 @@ static int cbq_init(struct Qdisc *sch, struct nlattr *opt)cbq_addprio (q, &q->link);return 0 ; +put_block: +tcf_block_put (q->link.block); + put_rtab:qdisc_put_rtab (q->link.R_tab);return err;
Signature · 1 line
2.9.5
Quoted 6 lines · Jiri Pirko
From: Jiri Pirko <[email protected]>
q->link.blockis not initialized, that leads to EINVAL when one tries to add filter there. So initialize it properly.This can be reproduced by:
By...? :-)
Quoted 41 lines
Reported-by Jaroslav Aster <[email protected]>Reported-by Ivan Vecera <[email protected]>Fixes 6529eaba33f0 ("net: sched: introduce tcf block infractructure")Signed-off-by Jiri Pirko <[email protected]>--- net/sched/sch_cbq.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)net/sched/sch_cbq.c +8
-1@@ -1158,9 +1158,13 @@ static int cbq_init(struct Qdisc *sch, struct nlattr *opt)if ((q->link.R_tab =qdisc_get_rtab (r, tb[TCA_CBQ_RTAB ])) ==NULL )return -EINVAL ; + err =tcf_block_get (&q->link.block, &q->link.filter_list, sch); +if (err) + goto put_rtab; + err =qdisc_class_hash_init (&q->clhash);if (err <0 ) - goto put_rtab; + goto put_block; q->link.sibling = &q->link; q->link.common.classid = sch->handle;@@ -1194,6 +1198,9 @@ static int cbq_init(struct Qdisc *sch, struct nlattr *opt)cbq_addprio (q, &q->link);return 0 ; +put_block: +tcf_block_put (q->link.block); + put_rtab:qdisc_put_rtab (q->link.R_tab);return err;Signature · 1 line
2.9.5
Jiri Pirko
maintainerQuoted 9 lines · Mon, Nov 27, 2017 at 06:30:43PM CET, [email protected] wrote:
Quoted 6 lines · Jiri Pirko
From: Jiri Pirko <[email protected]>
q->link.blockis not initialized, that leads to EINVAL when one tries to add filter there. So initialize it properly.This can be reproduced by:
By...? :-)
Ha, I guess that git-send-email avoids the lines starting by "#" :), resending.