From 4d3d422dffd3b5b2dcbfc88728caf31d119fc7e2 Mon Sep 17 00:00:00 2001 From: Feng Tian Date: Thu, 18 Sep 2014 06:06:25 +0000 Subject: 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 Reviewed-by: Star Zeng git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16128 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'MdeModulePkg/Bus/Usb') 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.
+Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
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; } -- cgit v1.2.3