mirror of
https://github.com/reactos/reactos.git
synced 2025-07-30 19:52:05 +00:00
[USBCCGP]
- reset interface count before loop - add extra checks svn path=/trunk/; revision=66483
This commit is contained in:
parent
7a357f830c
commit
1b229a4827
1 changed files with 11 additions and 0 deletions
|
@ -326,6 +326,11 @@ USBCCGP_ScanConfigurationDescriptor(
|
|||
// count all interface descriptors
|
||||
//
|
||||
DescriptorCount = ConfigurationDescriptor->bNumInterfaces;
|
||||
if (DescriptorCount == 0)
|
||||
{
|
||||
DPRINT1("[USBCCGP] DescriptorCount is zero\n");
|
||||
return STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
//
|
||||
// allocate array holding the interface descriptors
|
||||
|
@ -339,6 +344,11 @@ USBCCGP_ScanConfigurationDescriptor(
|
|||
return STATUS_INSUFFICIENT_RESOURCES;
|
||||
}
|
||||
|
||||
//
|
||||
// reset interface list count
|
||||
//
|
||||
FDODeviceExtension->InterfaceListCount = 0;
|
||||
|
||||
do
|
||||
{
|
||||
//
|
||||
|
@ -350,6 +360,7 @@ USBCCGP_ScanConfigurationDescriptor(
|
|||
//
|
||||
// store in interface list
|
||||
//
|
||||
ASSERT(FDODeviceExtension->InterfaceListCount < DescriptorCount);
|
||||
FDODeviceExtension->InterfaceList[FDODeviceExtension->InterfaceListCount].InterfaceDescriptor = InterfaceDescriptor;
|
||||
FDODeviceExtension->InterfaceListCount++;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue