mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
Fix nasty condition when we were subtracting AlignedAddress (which happened to be aligned to 0x80000000) from HighestAddress (which is MmSystemRangeStart - 1 == 0x7fffffff) and then using it for length comparsion.
svn path=/trunk/; revision=14214
This commit is contained in:
parent
b0fb19733c
commit
4cae592ec2
1 changed files with 2 additions and 1 deletions
|
@ -491,7 +491,8 @@ MmFindGapBottomUp(
|
||||||
|
|
||||||
/* Check if there is enough space after the last memory area. */
|
/* Check if there is enough space after the last memory area. */
|
||||||
AlignedAddress = MM_ROUND_UP(PreviousNode->EndingAddress, Granularity);
|
AlignedAddress = MM_ROUND_UP(PreviousNode->EndingAddress, Granularity);
|
||||||
if ((ULONG_PTR)HighestAddress - (ULONG_PTR)AlignedAddress >= Length)
|
if ((ULONG_PTR)HighestAddress > (ULONG_PTR)AlignedAddress &&
|
||||||
|
(ULONG_PTR)HighestAddress - (ULONG_PTR)AlignedAddress >= Length)
|
||||||
{
|
{
|
||||||
DPRINT("MmFindGapBottomUp: %p\n", AlignedAddress);
|
DPRINT("MmFindGapBottomUp: %p\n", AlignedAddress);
|
||||||
return AlignedAddress;
|
return AlignedAddress;
|
||||||
|
|
Loading…
Reference in a new issue