Rémi Bernon : winebus.sys: Don't enter critical section in bus_find_unix_device.

Alexandre Julliard julliard at winehq.org
Wed Oct 6 15:51:39 CDT 2021


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

Author: Rémi Bernon <rbernon at codeweavers.com>
Date:   Wed Oct  6 14:04:01 2021 +0200

winebus.sys: Don't enter critical section in bus_find_unix_device.

Callers are already holding it.

Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/winebus.sys/main.c | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/dlls/winebus.sys/main.c b/dlls/winebus.sys/main.c
index 6a4695cd3be..c9e930632e2 100644
--- a/dlls/winebus.sys/main.c
+++ b/dlls/winebus.sys/main.c
@@ -309,20 +309,11 @@ static DEVICE_OBJECT *bus_create_hid_device(struct device_desc *desc, struct uni
 static DEVICE_OBJECT *bus_find_unix_device(struct unix_device *unix_device)
 {
     struct device_extension *ext;
-    DEVICE_OBJECT *ret = NULL;
 
-    RtlEnterCriticalSection(&device_list_cs);
     LIST_FOR_EACH_ENTRY(ext, &device_list, struct device_extension, entry)
-    {
-        if (ext->unix_device == unix_device)
-        {
-            ret = ext->device;
-            break;
-        }
-    }
-    RtlLeaveCriticalSection(&device_list_cs);
+        if (ext->unix_device == unix_device) return ext->device;
 
-    return ret;
+    return NULL;
 }
 
 static void bus_unlink_hid_device(DEVICE_OBJECT *device)




More information about the wine-cvs mailing list