[NTOS:IO] IoConnectInterrupt(): Fix default spinlock initialization (#6503)

Addendum to commit d1258e99f (r16229).
This commit is contained in:
Serge Gautherie 2020-06-14 13:49:22 +02:00 committed by Hermès Bélusca-Maïto
parent cbc78e0629
commit 2d442956b4
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
2 changed files with 8 additions and 5 deletions

View file

@ -35,7 +35,6 @@ IoConnectInterrupt(OUT PKINTERRUPT *InterruptObject,
PKINTERRUPT Interrupt;
PKINTERRUPT InterruptUsed;
PIO_INTERRUPT IoInterrupt;
PKSPIN_LOCK SpinLockUsed;
BOOLEAN FirstRun;
CCHAR Count = 0;
KAFFINITY Affinity;
@ -64,8 +63,12 @@ IoConnectInterrupt(OUT PKINTERRUPT *InterruptObject,
TAG_KINTERRUPT);
if (!IoInterrupt) return STATUS_INSUFFICIENT_RESOURCES;
/* Select which Spinlock to use */
SpinLockUsed = SpinLock ? SpinLock : &IoInterrupt->SpinLock;
/* Use the structure's spinlock, if none was provided */
if (!SpinLock)
{
SpinLock = &IoInterrupt->SpinLock;
KeInitializeSpinLock(SpinLock);
}
/* We first start with a built-in Interrupt inside the I/O Structure */
*InterruptObject = &IoInterrupt->FirstInterrupt;
@ -87,7 +90,7 @@ IoConnectInterrupt(OUT PKINTERRUPT *InterruptObject,
KeInitializeInterrupt(InterruptUsed,
ServiceRoutine,
ServiceContext,
SpinLockUsed,
SpinLock,
Vector,
Irql,
SynchronizeIrql,

View file

@ -349,7 +349,7 @@ KeInitializeInterrupt(IN PKINTERRUPT Interrupt,
}
else
{
/* This means we'll be usin the built-in one */
/* Use the built-in one */
KeInitializeSpinLock(&Interrupt->SpinLock);
Interrupt->ActualLock = &Interrupt->SpinLock;
}