mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 08:25:03 +00:00
[NTOS:IO]
- Do not crash if an invalid PDO is given to IopEditDeviceList - Always dereference device object when removing it (should be the last reference) CORE-8294 svn path=/trunk/; revision=63917
This commit is contained in:
parent
b36bcbb154
commit
e3ab3c712a
2 changed files with 6 additions and 1 deletions
|
@ -351,6 +351,11 @@ IopEditDeviceList(IN PDRIVER_OBJECT DriverObject,
|
|||
while (Previous->NextDevice != DeviceObject)
|
||||
{
|
||||
/* Not this one, keep moving */
|
||||
if (!Previous->NextDevice)
|
||||
{
|
||||
DPRINT1("Failed to remove PDO %p on driver %wZ (not found)\n", DeviceObject, &DeviceObject->DriverObject->DriverName);
|
||||
return;
|
||||
}
|
||||
Previous = Previous->NextDevice;
|
||||
}
|
||||
|
||||
|
|
|
@ -597,6 +597,7 @@ IopSendRemoveDevice(IN PDEVICE_OBJECT DeviceObject)
|
|||
&GUID_TARGET_DEVICE_REMOVE_COMPLETE,
|
||||
NULL,
|
||||
NULL);
|
||||
ObDereferenceObject(DeviceObject);
|
||||
}
|
||||
|
||||
static
|
||||
|
@ -4431,7 +4432,6 @@ IopSendRemoveDeviceRelations(PDEVICE_RELATIONS DeviceRelations)
|
|||
for (i = 0; i < DeviceRelations->Count; i++)
|
||||
{
|
||||
IopSendRemoveDevice(DeviceRelations->Objects[i]);
|
||||
ObDereferenceObject(DeviceRelations->Objects[i]);
|
||||
DeviceRelations->Objects[i] = NULL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue