mirror of https://github.com/acidanthera/audk.git
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
This commit is contained in:
parent
a308e0588b
commit
4d3d422dff
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
Usb bus enumeration support.
|
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
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
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]);
|
UsbIf = UsbCreateInterface (Device, ConfigDesc->Interfaces[Index]);
|
||||||
|
|
||||||
if (UsbIf == NULL) {
|
if (UsbIf == NULL) {
|
||||||
|
Device->NumOfInterface = Index;
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue