Rémi Bernon : winebus.sys: Unlink device before releasing it.

Alexandre Julliard julliard at winehq.org
Mon Aug 16 18:07:25 CDT 2021


Module: wine
Branch: master
Commit: db410052a397d257dbbe88903336285741d8cb0b
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=db410052a397d257dbbe88903336285741d8cb0b

Author: Rémi Bernon <rbernon at codeweavers.com>
Date:   Mon Aug 16 09:04:28 2021 +0200

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 at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/winebus.sys/main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/dlls/winebus.sys/main.c b/dlls/winebus.sys/main.c
index 23c40e6895e..a60e3cc9a2c 100644
--- a/dlls/winebus.sys/main.c
+++ b/dlls/winebus.sys/main.c
@@ -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;




More information about the wine-cvs mailing list