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.
This commit is contained in:
Tim Crawford
2020-11-03 14:19:21 -07:00
parent cb870a1ce9
commit 06cc698885

View File

@ -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;
}