From 749d91f7aaeb9dcc8afc0bf6d9444caff2c2ad62 Mon Sep 17 00:00:00 2001 From: Harry Liebel Date: Tue, 26 Aug 2014 10:17:05 +0000 Subject: [PATCH] ArmPlatformPkg/Bds: Fix compiler warning - Fix RVCT warning: 'SecondEntry' may be uninitialised. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Harry Liebel Reviewed-By: Olivier Martin git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15904 6f19259b-4bc3-4df7-8a09-765794883524 --- ArmPlatformPkg/Bds/BootMenu.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ArmPlatformPkg/Bds/BootMenu.c b/ArmPlatformPkg/Bds/BootMenu.c index 42212385a8..25dc1d4ae6 100644 --- a/ArmPlatformPkg/Bds/BootMenu.c +++ b/ArmPlatformPkg/Bds/BootMenu.c @@ -691,6 +691,7 @@ BootMenuReorderBootOptions ( } SelectedEntry = &BootOptionEntry->Link; + SecondEntry = NULL; // Note down the previous entry in the list to be able to cancel changes PrevEntry = GetPreviousNode (BootOptionsList, SelectedEntry); @@ -739,7 +740,9 @@ BootMenuReorderBootOptions ( } while ((!Move) && (!Save) && (!Cancel)); if (Move) { - SwapListEntries (SelectedEntry, SecondEntry); + if ((SelectedEntry != NULL) && (SecondEntry != NULL)) { + SwapListEntries (SelectedEntry, SecondEntry); + } } else { if (Save) { Status = GetGlobalEnvironmentVariable (