]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPlatformPkg/Bds: Fix compiler warning
authorHarry Liebel <Harry.Liebel@arm.com>
Tue, 26 Aug 2014 10:17:05 +0000 (10:17 +0000)
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 26 Aug 2014 10:17:05 +0000 (10:17 +0000)
- Fix RVCT warning: 'SecondEntry' may be uninitialised.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Harry Liebel <Harry.Liebel@arm.com>
Reviewed-By: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15904 6f19259b-4bc3-4df7-8a09-765794883524

ArmPlatformPkg/Bds/BootMenu.c

index 42212385a860fcd13e6714a8b613fe705aa230e9..25dc1d4ae6bc379721a61025c950fa862f052938 100644 (file)
@@ -691,6 +691,7 @@ BootMenuReorderBootOptions (
     }\r
 \r
     SelectedEntry = &BootOptionEntry->Link;\r
+    SecondEntry = NULL;\r
     // Note down the previous entry in the list to be able to cancel changes\r
     PrevEntry = GetPreviousNode (BootOptionsList, SelectedEntry);\r
 \r
@@ -739,7 +740,9 @@ BootMenuReorderBootOptions (
       } while ((!Move) && (!Save) && (!Cancel));\r
 \r
       if (Move) {\r
-        SwapListEntries (SelectedEntry, SecondEntry);\r
+        if ((SelectedEntry != NULL) && (SecondEntry != NULL)) {\r
+          SwapListEntries (SelectedEntry, SecondEntry);\r
+        }\r
       } else {\r
         if (Save) {\r
           Status = GetGlobalEnvironmentVariable (\r