summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c
diff options
context:
space:
mode:
Diffstat (limited to 'MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c')
-rw-r--r--MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c b/MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c
index 00a109437..a3a28f3ed 100644
--- a/MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c
+++ b/MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c
@@ -1550,19 +1550,24 @@ UhciCleanDevUp (
)
{
USB_HC_DEV *Uhc;
+ EFI_STATUS Status;
//
// Uninstall the USB_HC and USB_HC2 protocol, then disable the controller
//
Uhc = UHC_FROM_USB2_HC_PROTO (This);
- UhciStopHc (Uhc, UHC_GENERIC_TIMEOUT);
- gBS->UninstallProtocolInterface (
- Controller,
- &gEfiUsb2HcProtocolGuid,
- &Uhc->Usb2Hc
- );
+ Status = gBS->UninstallProtocolInterface (
+ Controller,
+ &gEfiUsb2HcProtocolGuid,
+ &Uhc->Usb2Hc
+ );
+ if (EFI_ERROR (Status)) {
+ return ;
+ }
+
+ UhciStopHc (Uhc, UHC_GENERIC_TIMEOUT);
UhciFreeAllAsyncReq (Uhc);
UhciDestoryFrameList (Uhc);