diff options
author | Keir Fraser <keir@xen.org> | 2010-12-15 10:32:22 +0000 |
---|---|---|
committer | Keir Fraser <keir@xen.org> | 2010-12-15 10:32:22 +0000 |
commit | 0f496f4bb7316325026083db31591ec46e1c4d0a (patch) | |
tree | 1fd09bef25635797ba7358bc44a87bdf170a6913 | |
parent | 09e5f79b22aa19dd18bc63dd10f03f5ffddc2def (diff) | |
download | xen-0f496f4bb7316325026083db31591ec46e1c4d0a.tar.gz xen-0f496f4bb7316325026083db31591ec46e1c4d0a.tar.bz2 xen-0f496f4bb7316325026083db31591ec46e1c4d0a.zip |
tmem: two wrongs (or three lefts and a wrong) make a right
These two bugs apparently complement each other enough that
they escaped problems in my testing, but eventually gum
up the works and are obviously horribly wrong.
Found while developing tmem for native Linux.
Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
xen-unstable changeset: 22525:01f3b3509023
xen-unstable date: Wed Dec 15 10:27:18 2010 +0000
-rw-r--r-- | xen/common/tmem.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/xen/common/tmem.c b/xen/common/tmem.c index 8a5272bf9d..f1f93728c7 100644 --- a/xen/common/tmem.c +++ b/xen/common/tmem.c @@ -863,17 +863,17 @@ int oid_compare(OID *left, OID *right) { if ( left->oid[0] == right->oid[0] ) return 0; - else if ( left->oid[0] < left->oid[0] ) + else if ( left->oid[0] < right->oid[0] ) return -1; else return 1; } - else if ( left->oid[1] < left->oid[1] ) + else if ( left->oid[1] < right->oid[1] ) return -1; else return 1; } - else if ( left->oid[2] < left->oid[2] ) + else if ( left->oid[2] < right->oid[2] ) return -1; else return 1; @@ -970,7 +970,7 @@ static NOINLINE int obj_rb_insert(struct rb_root *root, obj_t *obj) { this = container_of(*new, obj_t, rb_tree_node); parent = *new; - switch ( oid_compare(&obj->oid, &this->oid) ) + switch ( oid_compare(&this->oid, &obj->oid) ) { case 0: return 0; |