From: Patrick McHardy Date: Thu, 11 May 2006 19:22:03 +0000 (-0700) Subject: [NET_SCHED]: HFSC: fix thinko in hfsc_adjust_levels() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=210525d65d33d17eb6bea6c965ce442d60d9aa8d;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git [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 Signed-off-by: Patrick McHardy Signed-off-by: David S. Miller --- diff --git a/net/sched/sch_hfsc.c b/net/sched/sch_hfsc.c index 91132f6871d..f1c7bd29f2c 100644 --- a/net/sched/sch_hfsc.c +++ b/net/sched/sch_hfsc.c @@ -974,10 +974,10 @@ hfsc_adjust_levels(struct hfsc_class *cl) do { level = 0; list_for_each_entry(p, &cl->children, siblings) { - if (p->level > level) - level = p->level; + if (p->level >= level) + level = p->level + 1; } - cl->level = level + 1; + cl->level = level; } while ((cl = cl->cl_parent) != NULL); }