]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c
MdeModulePkg/Usb: All h/w related stop operation at DriverBindingStop() should be...
[mirror_edk2.git] / MdeModulePkg / Bus / Pci / UhciDxe / Uhci.c
index 00a1094376cf14a5831a4abd25b73ea8dd0707a6..a3a28f3edc2820698a83fd473d5bf3e9db8b499f 100644 (file)
@@ -1550,19 +1550,24 @@ UhciCleanDevUp (
   )\r
 {\r
   USB_HC_DEV          *Uhc;\r
+  EFI_STATUS          Status;\r
 \r
   //\r
   // Uninstall the USB_HC and USB_HC2 protocol, then disable the controller\r
   //\r
   Uhc = UHC_FROM_USB2_HC_PROTO (This);\r
-  UhciStopHc (Uhc, UHC_GENERIC_TIMEOUT);\r
 \r
-  gBS->UninstallProtocolInterface (\r
-        Controller,\r
-        &gEfiUsb2HcProtocolGuid,\r
-        &Uhc->Usb2Hc\r
-        );\r
 \r
+  Status = gBS->UninstallProtocolInterface (\r
+                  Controller,\r
+                  &gEfiUsb2HcProtocolGuid,\r
+                  &Uhc->Usb2Hc\r
+                  );\r
+  if (EFI_ERROR (Status)) {\r
+    return ;\r
+  }\r
+\r
+  UhciStopHc (Uhc, UHC_GENERIC_TIMEOUT);\r
   UhciFreeAllAsyncReq (Uhc);\r
   UhciDestoryFrameList (Uhc);\r
 \r