summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarry Liebel <Harry.Liebel@arm.com>2014-08-26 10:17:05 +0000
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2014-08-26 10:17:05 +0000
commit749d91f7aaeb9dcc8afc0bf6d9444caff2c2ad62 (patch)
tree40799c952cc2077eec101805b5d132eb56895f70
parentd340ef7542df932198652d0d16109428337c4b30 (diff)
downloadedk2-platforms-749d91f7aaeb9dcc8afc0bf6d9444caff2c2ad62.tar.xz
ArmPlatformPkg/Bds: Fix compiler warning
- 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
-rw-r--r--ArmPlatformPkg/Bds/BootMenu.c5
1 files changed, 4 insertions, 1 deletions
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 (