udevd: worker - allow passing NULL to worker_unref()

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
This commit is contained in:
Tom Gundersen 2015-05-06 17:36:39 +02:00 committed by Anthony G. Basile
parent 4e8a53c681
commit dae71aedd2

View File

@ -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);