MdeModulePkg RamDiskDxe: Fix incorrect RAM disk memory address calculation

EndingAddress is calculated incorrectly. Original code calculates it as
(StartingAddress + Size). Correct value should be (StartingAddress +
Size - 1.

Note:
Besides the changes made by Samer, Hao also fixed a similar issue in
RamDiskImpl.c

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Signed-off-by: Tapan Shah <tapandshah@hpe.com>
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Tapan Shah <tapandshah@hpe.com>
This commit is contained in:
Samer El-Haj-Mahmoud
2016-03-30 07:12:51 +08:00
committed by Hao Wu
parent 307a55fa01
commit 5eae4ff002
2 changed files with 4 additions and 3 deletions

View File

@@ -566,7 +566,7 @@ UpdateMainForm (
L" RAM Disk %d: [0x%lx, 0x%lx]\n",
Index,
PrivateData->StartingAddr,
PrivateData->StartingAddr + PrivateData->Size
PrivateData->StartingAddr + PrivateData->Size - 1
);
StringId = HiiSetString (ConfigPrivate->HiiHandle, 0, RamDiskStr, NULL);