From a03327088adddfb78815d29af207fe03532f211c Mon Sep 17 00:00:00 2001 From: Marcin Wojtas Date: Wed, 31 Jul 2019 14:25:19 +0800 Subject: [PATCH] MdeModulePkg/UsbBusDxe: Return error when the device is not present 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 Reviewed-by: Laszlo Ersek Reviewed-by: Hao A Wu --- MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c index 13edbeeec5..abb2afc61f 100644 --- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c +++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c @@ -725,6 +725,7 @@ UsbEnumerateNewDev ( if (!USB_BIT_IS_SET (PortState.PortStatus, USB_PORT_STAT_CONNECTION)) { DEBUG ((EFI_D_ERROR, "UsbEnumerateNewDev: No device present at port %d\n", Port)); + Status = EFI_NOT_FOUND; goto ON_ERROR; } else if (USB_BIT_IS_SET (PortState.PortStatus, USB_PORT_STAT_SUPER_SPEED)){ Child->Speed = EFI_USB_SPEED_SUPER;