Uninstall LoadedImage protocol if SMM driver returns error and is unloaded.
Original code does not uninstall LoadedImage protocol if SMM driver returns error and is unloaded. It causes a wrong LoadedImage protocol existing in system. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com> Reviewed-by: "Zeng, Star" <star.zeng@intel.com> Reviewed-by: "Kinney, Michael D" <michael.d.kinney@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18936 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
20ab326972
commit
02f02b16e2
@ -881,6 +881,20 @@ SmmDispatcher (
|
|||||||
if (EFI_ERROR(Status)){
|
if (EFI_ERROR(Status)){
|
||||||
UnregisterSmramProfileImage (DriverEntry, TRUE);
|
UnregisterSmramProfileImage (DriverEntry, TRUE);
|
||||||
SmmFreePages(DriverEntry->ImageBuffer, DriverEntry->NumberOfPage);
|
SmmFreePages(DriverEntry->ImageBuffer, DriverEntry->NumberOfPage);
|
||||||
|
//
|
||||||
|
// Uninstall LoadedImage
|
||||||
|
//
|
||||||
|
Status = gBS->UninstallProtocolInterface (
|
||||||
|
DriverEntry->ImageHandle,
|
||||||
|
&gEfiLoadedImageProtocolGuid,
|
||||||
|
DriverEntry->LoadedImage
|
||||||
|
);
|
||||||
|
if (!EFI_ERROR (Status)) {
|
||||||
|
if (DriverEntry->LoadedImage->FilePath != NULL) {
|
||||||
|
gBS->FreePool (DriverEntry->LoadedImage->FilePath);
|
||||||
|
}
|
||||||
|
gBS->FreePool (DriverEntry->LoadedImage);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
REPORT_STATUS_CODE_WITH_EXTENDED_DATA (
|
REPORT_STATUS_CODE_WITH_EXTENDED_DATA (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user