winebus.sys: Unlink device before releasing it.

Otherwise the device will still be linked in the device list and any
thread iterating it to find a matching device will access stale pointer.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2021-08-16 09:04:28 +02:00 committed by Alexandre Julliard
parent d3885f92fc
commit db410052a3
1 changed files with 1 additions and 0 deletions

View File

@ -712,6 +712,7 @@ static NTSTATUS pdo_pnp_dispatch(DEVICE_OBJECT *device, IRP *irp)
remove_pending_irps(device);
bus_unlink_hid_device(device);
ext->vtbl->free_device(device);
ext->cs.DebugInfo->Spare[0] = 0;