提交 210525d6 编写于 作者: P Patrick McHardy 提交者: David S. Miller

[NET_SCHED]: HFSC: fix thinko in hfsc_adjust_levels()

When deleting the last child the level of a class should drop to zero.

Noticed by Andreas Mueller <andreas@stapelspeicher.org>
Signed-off-by: NPatrick McHardy <kaber@trash.net>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 b0013fd4
...@@ -974,10 +974,10 @@ hfsc_adjust_levels(struct hfsc_class *cl) ...@@ -974,10 +974,10 @@ hfsc_adjust_levels(struct hfsc_class *cl)
do { do {
level = 0; level = 0;
list_for_each_entry(p, &cl->children, siblings) { list_for_each_entry(p, &cl->children, siblings) {
if (p->level > level) if (p->level >= level)
level = p->level; level = p->level + 1;
} }
cl->level = level + 1; cl->level = level;
} while ((cl = cl->cl_parent) != NULL); } while ((cl = cl->cl_parent) != NULL);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册