From: Star Zeng Date: Tue, 13 Mar 2018 01:18:03 +0000 (+0800) Subject: SecurityPkg OpalPasswordDxe: Return directly if no any device X-Git-Tag: edk2-stable201903~2099 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=fbe1328a51136538ec985ce7b9ef7cf97ba999e9;ds=sidebyside SecurityPkg OpalPasswordDxe: Return directly if no any device Return directly if no any device in EndOfDxe notification. Cc: Jiewen Yao Cc: Eric Dong Cc: Chao Zhang Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng Reviewed-by: Jiewen Yao --- 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. //