summaryrefslogtreecommitdiff
path: root/src/udev
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2015-05-06 17:36:39 +0200
committerTom Gundersen <teg@jklm.no>2015-05-06 18:35:55 +0200
commitc4fcf70a015e47ec894e1b9d0c1940caf652195b (patch)
tree9cce1c21d1a76ae09ffae40fe41529947c48666c /src/udev
parent8b46c3fc48767e36dbfb6b6ca3d8a12aa024fd40 (diff)
udevd: worker - allow passing NULL to worker_unref()
Diffstat (limited to 'src/udev')
-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 0458af1309..661047ea26 100644
--- a/src/udev/udevd.c
+++ b/src/udev/udevd.c
@@ -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);