summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2015-05-06 17:36:39 +0200
committerAnthony G. Basile <blueness@gentoo.org>2015-05-26 13:07:39 -0400
commitdae71aedd20af3eade4b8e0cb1dc68444a60c7ef (patch)
treef5d00f71521f3c626be812311a0b294213b7b3ef /src
parent4e8a53c6810ab423037b4eff75bf375fde3e0f5d (diff)
udevd: worker - allow passing NULL to worker_unref()
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src')
-rw-r--r--src/udev/udevd.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/udev/udevd.c b/src/udev/udevd.c
index 891e4c08b9..b921442337 100644
--- a/src/udev/udevd.c
+++ b/src/udev/udevd.c
@@ -153,8 +153,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);