mirror of
https://github.com/reactos/reactos.git
synced 2024-11-23 11:33:31 +08:00
[VIDEOPRT] Correctly detach from device stack in case of failure
This commit is contained in:
parent
13868ee0e8
commit
f0b8a1730e
@ -244,9 +244,7 @@ IntVideoPortCreateAdapterDeviceObject(
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
WARN_(VIDEOPRT, "IntCreateRegistryPath() call failed with status 0x%08x\n", Status);
|
||||
IoDeleteDevice(*DeviceObject);
|
||||
*DeviceObject = NULL;
|
||||
return Status;
|
||||
goto Failure;
|
||||
}
|
||||
|
||||
if (PhysicalDeviceObject != NULL)
|
||||
@ -314,9 +312,7 @@ IntVideoPortCreateAdapterDeviceObject(
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
ERR_(VIDEOPRT, "IntCreateNewRegistryPath() failed with status 0x%08x\n", Status);
|
||||
IoDeleteDevice(*DeviceObject);
|
||||
*DeviceObject = NULL;
|
||||
return Status;
|
||||
goto Failure;
|
||||
}
|
||||
|
||||
IntSetupDeviceSettingsKey(DeviceExtension);
|
||||
@ -329,9 +325,7 @@ IntVideoPortCreateAdapterDeviceObject(
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
ERR_(VIDEOPRT, "IntVideoPortAddDeviceMapLink() failed with status 0x%08x\n", Status);
|
||||
IoDeleteDevice(*DeviceObject);
|
||||
*DeviceObject = NULL;
|
||||
return Status;
|
||||
goto Failure;
|
||||
}
|
||||
|
||||
if (DisplayNumber == 0)
|
||||
@ -340,6 +334,13 @@ IntVideoPortCreateAdapterDeviceObject(
|
||||
}
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
|
||||
Failure:
|
||||
if (DeviceExtension->NextDeviceObject)
|
||||
IoDetachDevice(DeviceExtension->NextDeviceObject);
|
||||
IoDeleteDevice(*DeviceObject);
|
||||
*DeviceObject = NULL;
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user