]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev: do not call sd_event_source_disable_unref() in workers for event sources create...
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 29 Mar 2022 03:14:40 +0000 (12:14 +0900)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 29 Mar 2022 08:29:44 +0000 (10:29 +0200)
Fixes a bug introduced by 9612da361a825d70a9fd392f3ee5a53bf8896887.

src/udev/udevd.c

index 67d7733be2ddb4a0259569a2aef4bfb2debdf1fb..e39f99c152927d92938ce3f22398ff03c4d33833 100644 (file)
@@ -210,8 +210,10 @@ DEFINE_PRIVATE_HASH_OPS_WITH_VALUE_DESTRUCTOR(worker_hash_op, void, trivial_hash
 static void manager_clear_for_worker(Manager *manager) {
         assert(manager);
 
-        manager->inotify_event = sd_event_source_disable_unref(manager->inotify_event);
-        manager->kill_workers_event = sd_event_source_disable_unref(manager->kill_workers_event);
+        /* Do not use sd_event_source_disable_unref() here, as this is called by both workers and the
+         * main process. */
+        manager->inotify_event = sd_event_source_unref(manager->inotify_event);
+        manager->kill_workers_event = sd_event_source_unref(manager->kill_workers_event);
 
         manager->event = sd_event_unref(manager->event);