pkt_sched: move the sanity test in qdisc_list_add()
The WARN_ON(root == &noop_qdisc)) added in qdisc_list_add()
can trigger in normal conditions when devices are not up.
It should be done only right before the list_add_tail() call.
Fixes: e57a784d8c
("pkt_sched: set root qdisc before change() in attach_default_qdiscs()")
Reported-by: Valdis Kletnieks <Valdis.Kletnieks@vt.edu>
Tested-by: Mirco Tischler <mt-ml@gmx.de>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Родитель
92f092d16c
Коммит
37314363cd
|
@ -273,11 +273,12 @@ static struct Qdisc *qdisc_match_from_root(struct Qdisc *root, u32 handle)
|
|||
|
||||
void qdisc_list_add(struct Qdisc *q)
|
||||
{
|
||||
struct Qdisc *root = qdisc_dev(q)->qdisc;
|
||||
if ((q->parent != TC_H_ROOT) && !(q->flags & TCQ_F_INGRESS)) {
|
||||
struct Qdisc *root = qdisc_dev(q)->qdisc;
|
||||
|
||||
WARN_ON_ONCE(root == &noop_qdisc);
|
||||
if ((q->parent != TC_H_ROOT) && !(q->flags & TCQ_F_INGRESS))
|
||||
WARN_ON_ONCE(root == &noop_qdisc);
|
||||
list_add_tail(&q->list, &root->list);
|
||||
}
|
||||
}
|
||||
EXPORT_SYMBOL(qdisc_list_add);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче