]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Library/LegacyBootMaintUiLib/LegacyBootMaintUi.c
IntelFrameworkModulePkg/LegacyBootMaintUiLib: Add NULL pointer check
[mirror_edk2.git] / IntelFrameworkModulePkg / Library / LegacyBootMaintUiLib / LegacyBootMaintUi.c
index 740c95ca969f643996e6eced4e6297c2a0a37efa..a4828b7130c73d6ce44338798db418e7d4f64cb1 100644 (file)
@@ -15,7 +15,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include "LegacyBootMaintUi.h"\r
 \r
-LEGACY_BOOT_OPTION_CALLBACK_DATA  *mLegacyBootOptionPrivate;\r
+LEGACY_BOOT_OPTION_CALLBACK_DATA  *mLegacyBootOptionPrivate = NULL;\r
 EFI_GUID  mLegacyBootOptionGuid     = LEGACY_BOOT_OPTION_FORMSET_GUID;\r
 CHAR16    mLegacyBootStorageName[]  = L"LegacyBootData";\r
 BBS_TYPE  mBbsType[] = {BBS_FLOPPY, BBS_HARDDISK, BBS_CDROM, BBS_EMBED_NETWORK, BBS_BEV_DEVICE, BBS_UNKNOWN};\r
@@ -1486,7 +1486,7 @@ LegacyBootMaintUiLibDestructor (
 {\r
   EFI_STATUS    Status;\r
 \r
-  if (mLegacyBootOptionPrivate->DriverHandle != NULL) {\r
+  if (mLegacyBootOptionPrivate != NULL && mLegacyBootOptionPrivate->DriverHandle != NULL) {\r
     Status = gBS->UninstallMultipleProtocolInterfaces (\r
                     mLegacyBootOptionPrivate->DriverHandle,\r
                     &gEfiDevicePathProtocolGuid,\r