Skip to content

Commit

Permalink
[PKT_SCHED] sch_htb: Use hlist_del_init().
Browse files Browse the repository at this point in the history
Otherwise we can hit paths that (legally) do multiple deletes on the
same node and OOPS with the HLIST poison values there instead of
NULL.

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Stephen Hemminger authored and David S. Miller committed Nov 7, 2006
1 parent 9e950ef commit da33e3e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions net/sched/sch_htb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1284,8 +1284,7 @@ static void htb_destroy_class(struct Qdisc *sch, struct htb_class *cl)
struct htb_class, sibling));

/* note: this delete may happen twice (see htb_delete) */
if (!hlist_unhashed(&cl->hlist))
hlist_del(&cl->hlist);
hlist_del_init(&cl->hlist);
list_del(&cl->sibling);

if (cl->prio_activity)
Expand Down Expand Up @@ -1333,8 +1332,7 @@ static int htb_delete(struct Qdisc *sch, unsigned long arg)
sch_tree_lock(sch);

/* delete from hash and active; remainder in destroy_class */
if (!hlist_unhashed(&cl->hlist))
hlist_del(&cl->hlist);
hlist_del_init(&cl->hlist);

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

0 comments on commit da33e3e

Please sign in to comment.