lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Tue, 13 Jul 2010 18:30:54 +0800
From:	Xiaotian Feng <dfeng@...hat.com>
To:	linux-kernel@...r.kernel.org
Cc:	Xiaotian Feng <dfeng@...hat.com>,
	Suresh Siddha <suresh.b.siddha@...el.com>,
	Venkatesh Pallipadi <venki@...gle.com>,
	Ingo Molnar <mingo@...e.hu>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>
Subject: [PATCH -tip] rbtree: avoid func twice when node doesn't have a right sibling

In rb_augment_path(),

        if (node == parent->rb_left && parent->rb_right)
                func(parent->rb_right, data);
        else if (parent->rb_left)
                func(parent->rb_left, data);

If (node == parent->rb_left && !parent->rb_right), then kernel will
func(node,data) twice.

Signed-off-by: Xiaotian Feng <dfeng@...hat.com>
Cc: Suresh Siddha <suresh.b.siddha@...el.com>
Cc: Venkatesh Pallipadi <venki@...gle.com>
Cc: Xiaotian Feng <dfeng@...hat.com>
Cc: Ingo Molnar <mingo@...e.hu>
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
---
 lib/rbtree.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/rbtree.c b/lib/rbtree.c
index 4693f79..7bb8f7f 100644
--- a/lib/rbtree.c
+++ b/lib/rbtree.c
@@ -295,7 +295,7 @@ up:
 
 	if (node == parent->rb_left && parent->rb_right)
 		func(parent->rb_right, data);
-	else if (parent->rb_left)
+	else if (node == parent->rb_right && parent->rb_left)
 		func(parent->rb_left, data);
 
 	node = parent;
-- 
1.7.1.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ