From: Tom Gundersen Date: Wed, 6 May 2015 15:36:39 +0000 (+0200) Subject: udevd: worker - allow passing NULL to worker_unref() X-Git-Tag: v220~185 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c4fcf70a015e47ec894e1b9d0c1940caf652195b;p=thirdparty%2Fsystemd.git udevd: worker - allow passing NULL to worker_unref() --- diff --git a/src/udev/udevd.c b/src/udev/udevd.c index 0458af13090..661047ea264 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);