Avoid an unnecessary memory dereference in vm_map_entry_splay().

This commit is contained in:
Alan Cox 2008-12-30 21:52:18 +00:00
parent e7f54c1b71
commit 7438d60b4b

View File

@ -737,9 +737,9 @@ vm_map_entry_splay(vm_offset_t addr, vm_map_entry_t root)
rlist = root;
root = y;
}
} else {
} else if (addr >= root->end) {
y = root->right;
if (addr < root->end || y == NULL)
if (y == NULL)
break;
if (addr >= y->end && y->right != NULL) {
/* Rotate left and put y on llist. */
@ -755,7 +755,8 @@ vm_map_entry_splay(vm_offset_t addr, vm_map_entry_t root)
llist = root;
root = y;
}
}
} else
break;
}
/*