From 74bea389418bf54dfc4c4800bf68fafef532cddc Mon Sep 17 00:00:00 2001 From: Ivo Ivanov Date: Sat, 22 Oct 2022 06:39:58 +0300 Subject: [PATCH] winebus.sys: Search for added devices by devnode path in process_monitor_event(). Fixes process_monitor_event() failing to remove already added devices. --- dlls/winebus.sys/bus_udev.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/dlls/winebus.sys/bus_udev.c b/dlls/winebus.sys/bus_udev.c index 21a70d0829b..71b9ef84530 100644 --- a/dlls/winebus.sys/bus_udev.c +++ b/dlls/winebus.sys/bus_udev.c @@ -260,16 +260,6 @@ static struct base_device *find_device_from_fd(int fd) return NULL; } -static struct base_device *find_device_from_udev(struct udev_device *dev) -{ - struct base_device *impl; - - LIST_FOR_EACH_ENTRY(impl, &device_list, struct base_device, unix_device.entry) - if (impl->udev_device == dev) return impl; - - return NULL; -} - static void hidraw_device_destroy(struct unix_device *iface) { struct hidraw_device *impl = hidraw_impl_from_unix_device(iface); @@ -1745,7 +1735,7 @@ static void process_monitor_event(struct udev_monitor *monitor) udev_add_device(dev, -1); else { - impl = find_device_from_udev(dev); + impl = find_device_from_devnode(udev_device_get_devnode(dev)); if (impl) bus_event_queue_device_removed(&event_queue, &impl->unix_device); else WARN("failed to find device for udev device %p\n", dev); }