Skip to content

Commit

Permalink
[NET_SCHED]: HFSC: fix thinko in hfsc_adjust_levels()
Browse files Browse the repository at this point in the history
When deleting the last child the level of a class should drop to zero.

Noticed by Andreas Mueller <andreas@stapelspeicher.org>

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Patrick McHardy authored and David S. Miller committed May 11, 2006
1 parent b0013fd commit 210525d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions net/sched/sch_hfsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 210525d

Please sign in to comment.