[ISAPNP] Properly count descriptors

Fixes random pool corruptions
This commit is contained in:
Dmitry Borisov 2021-03-04 18:47:16 +06:00
parent 2d367001bd
commit 8f36dee6ff

View file

@ -241,7 +241,7 @@ IsaPnpCreateLogicalDeviceResources(
for (i = 0; i < RTL_NUMBER_OF(LogDev->Io); i++) for (i = 0; i < RTL_NUMBER_OF(LogDev->Io); i++)
{ {
if (!LogDev->Io[i].CurrentBase) if (!LogDev->Io[i].CurrentBase)
continue; break;
Descriptor = &ResourceList->List[0].PartialResourceList.PartialDescriptors[ResourceCount++]; Descriptor = &ResourceList->List[0].PartialResourceList.PartialDescriptors[ResourceCount++];
Descriptor->Type = CmResourceTypePort; Descriptor->Type = CmResourceTypePort;
@ -256,7 +256,7 @@ IsaPnpCreateLogicalDeviceResources(
for (i = 0; i < RTL_NUMBER_OF(LogDev->Irq); i++) for (i = 0; i < RTL_NUMBER_OF(LogDev->Irq); i++)
{ {
if (!LogDev->Irq[i].CurrentNo) if (!LogDev->Irq[i].CurrentNo)
continue; break;
Descriptor = &ResourceList->List[0].PartialResourceList.PartialDescriptors[ResourceCount++]; Descriptor = &ResourceList->List[0].PartialResourceList.PartialDescriptors[ResourceCount++];
Descriptor->Type = CmResourceTypeInterrupt; Descriptor->Type = CmResourceTypeInterrupt;
@ -272,7 +272,7 @@ IsaPnpCreateLogicalDeviceResources(
for (i = 0; i < RTL_NUMBER_OF(LogDev->Dma); i++) for (i = 0; i < RTL_NUMBER_OF(LogDev->Dma); i++)
{ {
if (LogDev->Dma[i].CurrentChannel == 4) if (LogDev->Dma[i].CurrentChannel == 4)
continue; break;
Descriptor = &ResourceList->List[0].PartialResourceList.PartialDescriptors[ResourceCount++]; Descriptor = &ResourceList->List[0].PartialResourceList.PartialDescriptors[ResourceCount++];
Descriptor->Type = CmResourceTypeDma; Descriptor->Type = CmResourceTypeDma;