]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPlatformPkg/Bds: Fixed the deletion of boot option entries
authoroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 25 Jan 2013 11:50:59 +0000 (11:50 +0000)
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 25 Jan 2013 11:50:59 +0000 (11:50 +0000)
When deleting a boot entry from the boot menu all next entries must
be copied one entry up to rearrange the BootOrder list.

This patch fixes the copy: each boot entry is 16 bits, not 8 bits.

Signed-off-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14090 6f19259b-4bc3-4df7-8a09-765794883524

ArmPlatformPkg/Bds/BootOption.c

index 289d36a50badb9f44726380a96b53953a9961993..e562add3d1ab8f084ad0ed0d60d713765de48402 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 *\r
-*  Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
+*  Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
 *\r
 *  This program and the accompanying materials\r
 *  are licensed and made available under the terms and conditions of the BSD License\r
@@ -367,7 +367,11 @@ BootOptionDelete (
       if (BootOrder[Index] == BootOption->LoadOptionIndex) {\r
         // If it the last entry we do not need to rearrange the BootOrder list\r
         if (Index + 1 != BootOrderCount) {\r
-          CopyMem (&BootOrder[Index],&BootOrder[Index+1], BootOrderCount - (Index + 1));\r
+          CopyMem (\r
+            &BootOrder[Index],\r
+            &BootOrder[Index + 1],\r
+            (BootOrderCount - (Index + 1)) * sizeof(UINT16)\r
+            );\r
         }\r
         break;\r
       }\r