From 9380d92d6f9a373ed704c325244b1f67997a5913 Mon Sep 17 00:00:00 2001 From: Marc Hartmayer Date: Wed, 20 Feb 2019 11:05:45 +0100 Subject: [PATCH] udev: nodeStateInitializeEnumerate: remove watch handle in case of an error If the udev thread is stopped, it must be ensured that the watch handle is also removed from the main loop. Signed-off-by: Marc Hartmayer Reviewed-by: John Ferlan --- src/node_device/node_device_udev.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c index 54f372cd4a..4dd2e9004f 100644 --- a/src/node_device/node_device_udev.c +++ b/src/node_device/node_device_udev.c @@ -1802,6 +1802,8 @@ nodeStateInitializeEnumerate(void *opaque) error: virObjectLock(priv); + ignore_value(virEventRemoveHandle(priv->watch)); + priv->watch = -1; priv->threadQuit = true; virObjectUnlock(priv); }