[NTOS:IO] IoConnectInterrupt(): Zero-out the allocated structure at the correct place (#6503)

Addendum to commit d1258e99f (r16229).
This commit is contained in:
Hermès Bélusca-Maïto 2024-02-18 15:40:33 +01:00
parent 35d46b23f1
commit 603fd832d0
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0

View file

@ -57,11 +57,11 @@ IoConnectInterrupt(OUT PKINTERRUPT *InterruptObject,
/* Make sure we have a valid CPU count */
if (!Count) return STATUS_INVALID_PARAMETER;
/* Allocate the array of I/O Interrupts */
IoInterrupt = ExAllocatePoolWithTag(NonPagedPool,
(Count - 1) * sizeof(KINTERRUPT) +
sizeof(IO_INTERRUPT),
TAG_KINTERRUPT);
/* Allocate the array of I/O interrupts */
IoInterrupt = ExAllocatePoolZero(NonPagedPool,
(Count - 1) * sizeof(KINTERRUPT) +
sizeof(IO_INTERRUPT),
TAG_KINTERRUPT);
if (!IoInterrupt) return STATUS_INSUFFICIENT_RESOURCES;
/* Select which Spinlock to use */
@ -72,9 +72,6 @@ IoConnectInterrupt(OUT PKINTERRUPT *InterruptObject,
Interrupt = (PKINTERRUPT)(IoInterrupt + 1);
FirstRun = TRUE;
/* Start with a fresh structure */
RtlZeroMemory(IoInterrupt, sizeof(IO_INTERRUPT));
/* Now create all the interrupts */
Affinity = ProcessorEnableMask & KeActiveProcessors;
for (Count = 0; Affinity; Count++, Affinity >>= 1)