Skip to content

Commit

Permalink
pkt_sched: Fix oops in htb_delete.
Browse files Browse the repository at this point in the history
Recent changes introduced a bug in htb_delete(): cl->parent->children
counter update misses checking cl->parent for NULL, which is used for
root classes, so deleting them causes an oops.

Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jarek Poplawski authored and David S. Miller committed Aug 13, 2008
1 parent 64c00d8 commit 26b284d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/sched/sch_htb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1279,7 +1279,8 @@ static int htb_delete(struct Qdisc *sch, unsigned long arg)

/* delete from hash and active; remainder in destroy_class */
qdisc_class_hash_remove(&q->clhash, &cl->common);
cl->parent->children--;
if (cl->parent)
cl->parent->children--;

if (cl->prio_activity)
htb_deactivate(q, cl);
Expand Down

0 comments on commit 26b284d

Please sign in to comment.