device: do not pull device present state from hotplug events
authorFelix Fietkau <nbd@nbd.name>
Tue, 3 Sep 2024 08:11:26 +0000 (10:11 +0200)
committerFelix Fietkau <nbd@nbd.name>
Tue, 3 Sep 2024 10:02:02 +0000 (12:02 +0200)
Use hotplug events as trigger for system_if_check instead.
Fixes a race condition in event processing

Signed-off-by: Felix Fietkau <nbd@nbd.name>
device.c

index 32e42a604e435121359408ca5525978d8efcc70d..8513f726009cf6df364e4e68d71e4aba6c4f5ca5 100644 (file)
--- a/device.c
+++ b/device.c
@@ -1472,5 +1472,5 @@ void device_hotplug_event(const char *name, bool add)
        if (!dev || dev->type != &simple_device_type)
                return;
 
-       device_set_present(dev, add);
+       system_if_check(dev);
 }