]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/UsbBusDxe: Return error when the device is not present
authorMarcin Wojtas <mw@semihalf.com>
Wed, 31 Jul 2019 06:25:19 +0000 (14:25 +0800)
committerHao A Wu <hao.a.wu@intel.com>
Mon, 5 Aug 2019 01:35:33 +0000 (09:35 +0800)
Until now, during the USB device enumeration when its PortState
USB_PORT_STAT_CONNECTION bit was not set, the stack was not informed
that the device is not present. Fix that by returning appropriate
error code.

Signed-off-by: Marcin Wojtas <mw@semihalf.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c

index 0cded1eea7436254733d230a27d76e722f7410d2..eaa0d70024bb8a6b786d39a146ecb92c3bd5eb42 100644 (file)
@@ -719,6 +719,7 @@ UsbEnumerateNewDev (
 \r
   if (!USB_BIT_IS_SET (PortState.PortStatus, USB_PORT_STAT_CONNECTION)) {\r
     DEBUG ((EFI_D_ERROR, "UsbEnumerateNewDev: No device present at port %d\n", Port));\r
+    Status = EFI_NOT_FOUND;\r
     goto ON_ERROR;\r
   } else if (USB_BIT_IS_SET (PortState.PortStatus, USB_PORT_STAT_SUPER_SPEED)){\r
     Child->Speed      = EFI_USB_SPEED_SUPER;\r