From 49a25d849008b0282d91eeeb7318b45ba4b9aced Mon Sep 17 00:00:00 2001 From: oliviermartin Date: Thu, 9 Feb 2012 15:33:02 +0000 Subject: [PATCH] ArmPlatformPkg/Bds: Fixed update of boot entries There were some incorrect pointer calculations. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12999 6f19259b-4bc3-4df7-8a09-765794883524 --- ArmPlatformPkg/Bds/BootMenu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ArmPlatformPkg/Bds/BootMenu.c b/ArmPlatformPkg/Bds/BootMenu.c index 8202f9991c..e7e475dfc1 100644 --- a/ArmPlatformPkg/Bds/BootMenu.c +++ b/ArmPlatformPkg/Bds/BootMenu.c @@ -1,6 +1,6 @@ /** @file * -* Copyright (c) 2011, ARM Limited. All rights reserved. +* Copyright (c) 2011-2012, ARM Limited. All rights reserved. * * This program and the accompanying materials * are licensed and made available under the terms and conditions of the BSD License @@ -406,7 +406,7 @@ BootMenuUpdateBootOption ( if (InitrdSupport) { if (InitrdSize > 0) { // Case we update the initrd device path - Status = DeviceSupport->UpdateDevicePathNode ((EFI_DEVICE_PATH*)((LinuxArguments + 1) + CmdLineSize), L"initrd", &InitrdPath, NULL, NULL); + Status = DeviceSupport->UpdateDevicePathNode ((EFI_DEVICE_PATH*)((UINTN)(LinuxArguments + 1) + CmdLineSize), L"initrd", &InitrdPath, NULL, NULL); if (EFI_ERROR(Status) && Status != EFI_NOT_FOUND) {// EFI_NOT_FOUND is returned on empty input string, but we can boot without an initrd Status = EFI_ABORTED; goto EXIT; @@ -454,7 +454,7 @@ BootMenuUpdateBootOption ( BootArguments->LinuxArguments.CmdLineSize = CmdLineSize; BootArguments->LinuxArguments.InitrdSize = InitrdSize; CopyMem (&BootArguments->LinuxArguments + 1, CmdLine, CmdLineSize); - CopyMem ((UINTN)(&BootArguments->LinuxArguments + 1) + CmdLine, InitrdPath, InitrdSize); + CopyMem ((VOID*)((UINTN)(&BootArguments->LinuxArguments + 1) + CmdLineSize), InitrdPath, InitrdSize); } else { BootArguments = NULL; } -- 2.39.2