Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 210525d6 authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller
Browse files

[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: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b0013fd4
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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);
}