[NET_SCHED]: HTB: fix incorrect use of RB_EMPTY_NODE Fix incorrect use of RB_EMPTY_NODE in htb_safe_rb_erase, which makes it skip nodes within the rbtree instead of nodes not in the tree, resulting in crashes later on. The root cause for this seems to be the very counter-intuitive behaviour of the RB_EMPTY_NODE macro, which returns _false_ when the node is empty. Signed-off-by: Patrick McHardy --- commit 9a0cd6d60280d88c38791844c87548d45cf6f2c2 tree fdf4f4a46fb088d957322006828af557b8ce594a parent 7e4720201ad44ace85a443f41d668a62a737e7d0 author Patrick McHardy Wed, 27 Sep 2006 13:27:24 +0200 committer Patrick McHardy Wed, 27 Sep 2006 13:27:24 +0200 net/sched/sch_htb.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c index bb3ddd4..6c058e3 100644 --- a/net/sched/sch_htb.c +++ b/net/sched/sch_htb.c @@ -391,7 +391,7 @@ static inline void htb_add_class_to_row( /* If this triggers, it is a bug in this code, but it need not be fatal */ static void htb_safe_rb_erase(struct rb_node *rb, struct rb_root *root) { - if (RB_EMPTY_NODE(rb)) { + if (!RB_EMPTY_NODE(rb)) { WARN_ON(1); } else { rb_erase(rb, root);