From f51d729dd07288331a883aa990dfaf6e77006a93 Mon Sep 17 00:00:00 2001 From: Marc Hartmayer Date: Tue, 23 Apr 2024 20:08:54 +0200 Subject: [PATCH] node_device_udev: Take lock if `driver->privateData` is modified Since @driver->privateData is modified take the lock. Reviewed-by: Boris Fiuczynski Reviewed-by: Jonathon Jongsma Signed-off-by: Marc Hartmayer --- src/node_device/node_device_udev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c index 29d2a7677b..7329e5ef17 100644 --- a/src/node_device/node_device_udev.c +++ b/src/node_device/node_device_udev.c @@ -2232,7 +2232,9 @@ mdevctlEventHandleCallback(GFileMonitor *monitor G_GNUC_UNUSED, * configuration change, try to coalesce these changes by waiting for the * CHANGES_DONE_HINT event. As a fallback, add a timeout to trigger the * signal if that event never comes */ - scheduleMdevctlUpdate(priv, (event_type == G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT)); + VIR_WITH_OBJECT_LOCK_GUARD(priv) { + scheduleMdevctlUpdate(priv, (event_type == G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT)); + } }