]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiDpLib/Dp.c
ShellPkg/tftp: Convert from NULL class library to Dynamic Command
[mirror_edk2.git] / ShellPkg / Library / UefiDpLib / Dp.c
index 33f69a0c145a0df6132675db3b05b848feff0528..94fa61c7108e55e421e9cd98fdffa645379b4fa6 100644 (file)
@@ -250,7 +250,7 @@ ShellCommandRunDp (
     if (CustomCumulativeData == NULL) {\r
       return SHELL_OUT_OF_RESOURCES;\r
     }\r
-    CustomCumulativeData->MinDur = 0;\r
+    CustomCumulativeData->MinDur = PERF_MAXDUR;\r
     CustomCumulativeData->MaxDur = 0;\r
     CustomCumulativeData->Count  = 0;\r
     CustomCumulativeData->Duration = 0;\r
@@ -272,7 +272,7 @@ ShellCommandRunDp (
   //      EndCount = Value counter counts to before it needs to be reset\r
   //\r
   Status = EfiGetSystemConfigurationTable (&gPerformanceProtocolGuid, (VOID **) &PerformanceProperty);\r
-  if (EFI_ERROR (Status)) {\r
+  if (EFI_ERROR (Status) || (PerformanceProperty == NULL)) {\r
     ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PERF_PROPERTY_NOT_FOUND), gDpHiiHandle);\r
     goto Done;\r
   }\r