mirror of
https://github.com/reactos/reactos.git
synced 2024-07-06 20:55:16 +00:00
[NTOSKRNL]
- Fix kernel memory corruption when a driver fails to initialize - Fix a handle leak in a failure case svn path=/trunk/; revision=55887
This commit is contained in:
parent
c61e296b73
commit
ac6c5a4738
|
@ -1538,6 +1538,10 @@ try_again:
|
|||
KernelMode,
|
||||
(PVOID*)&DriverObject,
|
||||
NULL);
|
||||
|
||||
/* Close the extra handle */
|
||||
ZwClose(hDriver);
|
||||
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
/* Fail */
|
||||
|
@ -1546,9 +1550,6 @@ try_again:
|
|||
return Status;
|
||||
}
|
||||
|
||||
/* Close the extra handle */
|
||||
ZwClose(hDriver);
|
||||
|
||||
DriverObject->HardwareDatabase = &IopHardwareDatabaseKey;
|
||||
DriverObject->DriverStart = ModuleObject ? ModuleObject->DllBase : 0;
|
||||
DriverObject->DriverSize = ModuleObject ? ModuleObject->SizeOfImage : 0;
|
||||
|
@ -1564,6 +1565,7 @@ try_again:
|
|||
DriverObject->DriverSection = NULL;
|
||||
ObMakeTemporaryObject(DriverObject);
|
||||
ObDereferenceObject(DriverObject);
|
||||
return Status;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue