SecurityPkg OpalPasswordDxe: Return directly if no any device
authorStar Zeng <star.zeng@intel.com>
Tue, 13 Mar 2018 01:18:03 +0000 (09:18 +0800)
committerStar Zeng <star.zeng@intel.com>
Sat, 17 Mar 2018 07:41:03 +0000 (15:41 +0800)
Return directly if no any device in EndOfDxe notification.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c

index d2597ce..1b55bbe 100644 (file)
@@ -610,6 +610,14 @@ OpalEndOfDxeEventNotify (
     mOpalRequestVariableSize = 0;\r
   }\r
 \r
+  //\r
+  // If no any device, return directly.\r
+  //\r
+  if (mOpalDriver.DeviceList == NULL) {\r
+    gBS->CloseEvent (Event);\r
+    return;\r
+  }\r
+\r
   //\r
   // Assume 64K size and alignment are enough.\r
   //\r