Commit 80d53026 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

ntoskrnl.exe: Don't add device to the list if IoCreateDevice fails.

Spotted by Zebediah Figura. Signed-off-by: 's avatarJacek Caban <jacek@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 061f65f9
......@@ -1502,9 +1502,6 @@ NTSTATUS WINAPI IoCreateDevice( DRIVER_OBJECT *driver, ULONG ext_size,
device->DeviceType = type;
device->StackSize = 1;
device->NextDevice = driver->DeviceObject;
driver->DeviceObject = device;
SERVER_START_REQ( create_device )
{
req->rootdir = 0;
......@@ -1521,6 +1518,9 @@ NTSTATUS WINAPI IoCreateDevice( DRIVER_OBJECT *driver, ULONG ext_size,
return status;
}
device->NextDevice = driver->DeviceObject;
driver->DeviceObject = device;
*ret_device = device;
return STATUS_SUCCESS;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment