]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udevd: worker - allow passing NULL to worker_unref()
authorTom Gundersen <teg@jklm.no>
Wed, 6 May 2015 15:36:39 +0000 (17:36 +0200)
committerTom Gundersen <teg@jklm.no>
Wed, 6 May 2015 16:35:55 +0000 (18:35 +0200)
src/udev/udevd.c

index 0458af1309083c7a53440587b5a776df437091ad..661047ea264c93dac8479a5f644b1f4a6e63c040 100644 (file)
@@ -150,8 +150,7 @@ static void worker_cleanup(struct worker *worker) {
 }
 
 static void worker_unref(struct worker *worker) {
-        worker->refcount--;
-        if (worker->refcount > 0)
+        if (!worker || (-- worker->refcount) > 0)
                 return;
         log_debug("worker ["PID_FMT"] cleaned up", worker->pid);
         worker_cleanup(worker);