diff options
Diffstat (limited to 'MdeModulePkg/Application/CapsuleApp/CapsuleOnDisk.c')
-rw-r--r-- | MdeModulePkg/Application/CapsuleApp/CapsuleOnDisk.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/MdeModulePkg/Application/CapsuleApp/CapsuleOnDisk.c b/MdeModulePkg/Application/CapsuleApp/CapsuleOnDisk.c index 393b7ae7db..4faa863bca 100644 --- a/MdeModulePkg/Application/CapsuleApp/CapsuleOnDisk.c +++ b/MdeModulePkg/Application/CapsuleApp/CapsuleOnDisk.c @@ -151,9 +151,14 @@ DumpAllEfiSysPartition ( UINTN NumberEfiSystemPartitions;
EFI_SHELL_PROTOCOL *ShellProtocol;
- ShellProtocol = GetShellProtocol ();
NumberEfiSystemPartitions = 0;
+ ShellProtocol = GetShellProtocol ();
+ if (ShellProtocol == NULL) {
+ Print (L"Get Shell Protocol Fail\n");;
+ return ;
+ }
+
Print (L"EFI System Partition list:\n");
gBS->LocateHandleBuffer (
@@ -421,7 +426,13 @@ GetUpdateFileSystem ( EFI_BOOT_MANAGER_LOAD_OPTION NewOption;
MappedDevicePath = NULL;
+ BootOptionBuffer = NULL;
+
ShellProtocol = GetShellProtocol ();
+ if (ShellProtocol == NULL) {
+ Print (L"Get Shell Protocol Fail\n");;
+ return EFI_NOT_FOUND;
+ }
//
// 1. If Fs is not assigned and there are capsule provisioned before,
@@ -468,7 +479,9 @@ GetUpdateFileSystem ( // 2. Get EFI system partition form boot options.
//
BootOptionBuffer = EfiBootManagerGetLoadOptions (&BootOptionCount, LoadOptionTypeBoot);
- if (BootOptionCount == 0 && Map == NULL) {
+ if ( (BootOptionBuffer == NULL) ||
+ (BootOptionCount == 0 && Map == NULL)
+ ) {
return EFI_NOT_FOUND;
}
|