git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[Bluetooth] Add hci_recv_fragment() helper function
[pandora-kernel.git]
/
lib
/
rbtree.c
diff --git
a/lib/rbtree.c
b/lib/rbtree.c
index
1e55ba1
..
48499c2
100644
(file)
--- a/
lib/rbtree.c
+++ b/
lib/rbtree.c
@@
-322,6
+322,9
@@
struct rb_node *rb_next(struct rb_node *node)
{
struct rb_node *parent;
{
struct rb_node *parent;
+ if (rb_parent(node) == node)
+ return NULL;
+
/* If we have a right-hand child, go down and then left as far
as we can. */
if (node->rb_right) {
/* If we have a right-hand child, go down and then left as far
as we can. */
if (node->rb_right) {
@@
-348,6
+351,9
@@
struct rb_node *rb_prev(struct rb_node *node)
{
struct rb_node *parent;
{
struct rb_node *parent;
+ if (rb_parent(node) == node)
+ return NULL;
+
/* If we have a left-hand child, go down and then right as far
as we can. */
if (node->rb_left) {
/* If we have a left-hand child, go down and then right as far
as we can. */
if (node->rb_left) {