From: Marc Hartmayer Date: Wed, 20 Feb 2019 10:05:45 +0000 (+0100) Subject: udev: nodeStateInitializeEnumerate: remove watch handle in case of an error X-Git-Tag: v5.1.0-rc1~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9380d92d6f9a373ed704c325244b1f67997a5913;p=thirdparty%2Flibvirt.git 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 --- 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); }