mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 19:12:57 +00:00
[VIDEOPRT] Correctly detach from device stack in case of failure
This commit is contained in:
parent
13868ee0e8
commit
f0b8a1730e
1 changed files with 10 additions and 9 deletions
|
@ -244,9 +244,7 @@ IntVideoPortCreateAdapterDeviceObject(
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
WARN_(VIDEOPRT, "IntCreateRegistryPath() call failed with status 0x%08x\n", Status);
|
WARN_(VIDEOPRT, "IntCreateRegistryPath() call failed with status 0x%08x\n", Status);
|
||||||
IoDeleteDevice(*DeviceObject);
|
goto Failure;
|
||||||
*DeviceObject = NULL;
|
|
||||||
return Status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PhysicalDeviceObject != NULL)
|
if (PhysicalDeviceObject != NULL)
|
||||||
|
@ -314,9 +312,7 @@ IntVideoPortCreateAdapterDeviceObject(
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
ERR_(VIDEOPRT, "IntCreateNewRegistryPath() failed with status 0x%08x\n", Status);
|
ERR_(VIDEOPRT, "IntCreateNewRegistryPath() failed with status 0x%08x\n", Status);
|
||||||
IoDeleteDevice(*DeviceObject);
|
goto Failure;
|
||||||
*DeviceObject = NULL;
|
|
||||||
return Status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
IntSetupDeviceSettingsKey(DeviceExtension);
|
IntSetupDeviceSettingsKey(DeviceExtension);
|
||||||
|
@ -329,9 +325,7 @@ IntVideoPortCreateAdapterDeviceObject(
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
ERR_(VIDEOPRT, "IntVideoPortAddDeviceMapLink() failed with status 0x%08x\n", Status);
|
ERR_(VIDEOPRT, "IntVideoPortAddDeviceMapLink() failed with status 0x%08x\n", Status);
|
||||||
IoDeleteDevice(*DeviceObject);
|
goto Failure;
|
||||||
*DeviceObject = NULL;
|
|
||||||
return Status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DisplayNumber == 0)
|
if (DisplayNumber == 0)
|
||||||
|
@ -340,6 +334,13 @@ IntVideoPortCreateAdapterDeviceObject(
|
||||||
}
|
}
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
|
|
||||||
|
Failure:
|
||||||
|
if (DeviceExtension->NextDeviceObject)
|
||||||
|
IoDetachDevice(DeviceExtension->NextDeviceObject);
|
||||||
|
IoDeleteDevice(*DeviceObject);
|
||||||
|
*DeviceObject = NULL;
|
||||||
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue