diff options
author | Bi, Dandan <dandan.bi@intel.com> | 2017-08-25 10:58:36 +0800 |
---|---|---|
committer | Eric Dong <eric.dong@intel.com> | 2017-08-28 15:13:50 +0800 |
commit | ef5e0db22cdd73e9727afcaa5c7fe8e55b7b3671 (patch) | |
tree | 18fd0599c70eaf137b23f169278f6d06e10d3061 /IntelFrameworkModulePkg | |
parent | 34b6a0e22210b825ca5ea8447ac8bc513c0c96c5 (diff) | |
download | edk2-ef5e0db22cdd73e9727afcaa5c7fe8e55b7b3671.tar.gz edk2-ef5e0db22cdd73e9727afcaa5c7fe8e55b7b3671.tar.bz2 edk2-ef5e0db22cdd73e9727afcaa5c7fe8e55b7b3671.zip |
IntelFrameworkModulePkg/LegacyBootMaintUiLib: Add NULL pointer check
mLegacyBootOptionPrivate pointer is initialized in Constructor function
with if condition check, but it's used in Destructor function directly
without any check. Now add the NULL pointer check.
Cc: Eric Dong <eric.dong@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Diffstat (limited to 'IntelFrameworkModulePkg')
-rw-r--r-- | IntelFrameworkModulePkg/Library/LegacyBootMaintUiLib/LegacyBootMaintUi.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/IntelFrameworkModulePkg/Library/LegacyBootMaintUiLib/LegacyBootMaintUi.c b/IntelFrameworkModulePkg/Library/LegacyBootMaintUiLib/LegacyBootMaintUi.c index 740c95ca96..a4828b7130 100644 --- a/IntelFrameworkModulePkg/Library/LegacyBootMaintUiLib/LegacyBootMaintUi.c +++ b/IntelFrameworkModulePkg/Library/LegacyBootMaintUiLib/LegacyBootMaintUi.c @@ -15,7 +15,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include "LegacyBootMaintUi.h"
-LEGACY_BOOT_OPTION_CALLBACK_DATA *mLegacyBootOptionPrivate;
+LEGACY_BOOT_OPTION_CALLBACK_DATA *mLegacyBootOptionPrivate = NULL;
EFI_GUID mLegacyBootOptionGuid = LEGACY_BOOT_OPTION_FORMSET_GUID;
CHAR16 mLegacyBootStorageName[] = L"LegacyBootData";
BBS_TYPE mBbsType[] = {BBS_FLOPPY, BBS_HARDDISK, BBS_CDROM, BBS_EMBED_NETWORK, BBS_BEV_DEVICE, BBS_UNKNOWN};
@@ -1486,7 +1486,7 @@ LegacyBootMaintUiLibDestructor ( {
EFI_STATUS Status;
- if (mLegacyBootOptionPrivate->DriverHandle != NULL) {
+ if (mLegacyBootOptionPrivate != NULL && mLegacyBootOptionPrivate->DriverHandle != NULL) {
Status = gBS->UninstallMultipleProtocolInterfaces (
mLegacyBootOptionPrivate->DriverHandle,
&gEfiDevicePathProtocolGuid,
|