summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ShellPkg/Library/UefiShellDriver1CommandsLib/DrvDiag.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/DrvDiag.c b/ShellPkg/Library/UefiShellDriver1CommandsLib/DrvDiag.c
index 1173f8d7be..04f6a58c3d 100644
--- a/ShellPkg/Library/UefiShellDriver1CommandsLib/DrvDiag.c
+++ b/ShellPkg/Library/UefiShellDriver1CommandsLib/DrvDiag.c
@@ -123,7 +123,7 @@ DoDiagnostics (
if (ChildHandle != NULL) {
ChildHandleList = AllocateZeroPool(2*sizeof(EFI_HANDLE));
- if (ChildHandleList != NULL) {
+ if (ChildHandleList == NULL) {
SHELL_FREE_NON_NULL (ControllerHandleList);
SHELL_FREE_NON_NULL (DriverHandleList);
return EFI_OUT_OF_RESOURCES;