From 06cc69888522f20359c74a06c78b180777f4b8b1 Mon Sep 17 00:00:00 2001 From: Tim Crawford Date: Tue, 3 Nov 2020 14:19:21 -0700 Subject: [PATCH] MdeModulePkg/Core: Signal notify events on protocol removal In order for BootManager to maintain a valid list of boot options, it must know when the BlockIo protocol is also removed, not just added. --- MdeModulePkg/Core/Dxe/Hand/Notify.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/MdeModulePkg/Core/Dxe/Hand/Notify.c b/MdeModulePkg/Core/Dxe/Hand/Notify.c index 553413a350..17a3eefe22 100644 --- a/MdeModulePkg/Core/Dxe/Hand/Notify.c +++ b/MdeModulePkg/Core/Dxe/Hand/Notify.c @@ -70,6 +70,10 @@ CoreRemoveInterfaceFromProtocol ( for(Link = ProtEntry->Notify.ForwardLink; Link != &ProtEntry->Notify; Link=Link->ForwardLink) { ProtNotify = CR(Link, PROTOCOL_NOTIFY, Link, PROTOCOL_NOTIFY_SIGNATURE); + // Signal notify events before removing the protocol too. + // XXX: What effect does this have on other code? + CoreSignalEvent (ProtNotify->Event); + if (ProtNotify->Position == &Prot->ByProtocol) { ProtNotify->Position = Prot->ByProtocol.BackLink; }