diff options
author | erictian <erictian@6f19259b-4bc3-4df7-8a09-765794883524> | 2013-05-10 05:19:30 +0000 |
---|---|---|
committer | erictian <erictian@6f19259b-4bc3-4df7-8a09-765794883524> | 2013-05-10 05:19:30 +0000 |
commit | 70eca31be15bf93072641b8dccaa9de22af2d5f2 (patch) | |
tree | cd2afaf259c23e53cef4933d35feb26589b309f9 /MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.c | |
parent | 391206e7754ebe3c32e9d19d7a62ba3bbe43df6a (diff) | |
download | edk2-platforms-70eca31be15bf93072641b8dccaa9de22af2d5f2.tar.xz |
MdeMdeModulePkg/UsbBusDxe: Break device enumeration process if the device descriptor includes 0 configuration.
Signed-off-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Mike Wu <mike.wu@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14338 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.c')
-rw-r--r-- | MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.c b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.c index 35cdaf5527..1713e3c421 100644 --- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.c +++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.c @@ -786,10 +786,13 @@ UsbBuildDescTable ( return Status;
}
- DevDesc = UsbDev->DevDesc;
- NumConfig = DevDesc->Desc.NumConfigurations;
- DevDesc->Configs = AllocateZeroPool (NumConfig * sizeof (USB_CONFIG_DESC *));
+ DevDesc = UsbDev->DevDesc;
+ NumConfig = DevDesc->Desc.NumConfigurations;
+ if (NumConfig == 0) {
+ return EFI_DEVICE_ERROR;
+ }
+ DevDesc->Configs = AllocateZeroPool (NumConfig * sizeof (USB_CONFIG_DESC *));
if (DevDesc->Configs == NULL) {
return EFI_OUT_OF_RESOURCES;
}
|