diff --git a/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c b/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c index d2597ce33e..1b55bbe4ec 100644 --- a/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c +++ b/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c @@ -610,6 +610,14 @@ OpalEndOfDxeEventNotify ( mOpalRequestVariableSize = 0; } + // + // If no any device, return directly. + // + if (mOpalDriver.DeviceList == NULL) { + gBS->CloseEvent (Event); + return; + } + // // Assume 64K size and alignment are enough. //