summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c
diff options
context:
space:
mode:
authorFeng Tian <feng.tian@intel.com>2014-09-18 06:06:25 +0000
committererictian <erictian@6f19259b-4bc3-4df7-8a09-765794883524>2014-09-18 06:06:25 +0000
commit4d3d422dffd3b5b2dcbfc88728caf31d119fc7e2 (patch)
treecaac45f3e03b110211bfb03b80581b0638b851cb /MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c
parenta308e0588b3ad87b94611391e9e7a04a8eb05ebf (diff)
downloadedk2-4d3d422dffd3b5b2dcbfc88728caf31d119fc7e2.tar.gz
edk2-4d3d422dffd3b5b2dcbfc88728caf31d119fc7e2.tar.bz2
edk2-4d3d422dffd3b5b2dcbfc88728caf31d119fc7e2.zip
MdeModulePkg/UsbBusDxe: Update Device->NumOfInterface at error handling path to avoid system hang when DisconnectController is invoked to free resource occupied by usb device whose interface descriptor format doesn't follow usb spec.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16128 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c')
-rw-r--r--MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c
index f4aad66baf..79453fed26 100644
--- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c
+++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c
@@ -2,7 +2,7 @@
Usb bus enumeration support.
-Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -420,6 +420,7 @@ UsbSelectConfig (
UsbIf = UsbCreateInterface (Device, ConfigDesc->Interfaces[Index]);
if (UsbIf == NULL) {
+ Device->NumOfInterface = Index;
return EFI_OUT_OF_RESOURCES;
}