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
This commit is contained in:
erictian 2013-05-10 05:19:30 +00:00
parent 391206e775
commit 70eca31be1
1 changed files with 6 additions and 3 deletions

View File

@ -788,8 +788,11 @@ UsbBuildDescTable (
DevDesc = UsbDev->DevDesc; DevDesc = UsbDev->DevDesc;
NumConfig = DevDesc->Desc.NumConfigurations; NumConfig = DevDesc->Desc.NumConfigurations;
DevDesc->Configs = AllocateZeroPool (NumConfig * sizeof (USB_CONFIG_DESC *)); if (NumConfig == 0) {
return EFI_DEVICE_ERROR;
}
DevDesc->Configs = AllocateZeroPool (NumConfig * sizeof (USB_CONFIG_DESC *));
if (DevDesc->Configs == NULL) { if (DevDesc->Configs == NULL) {
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }