From dae71aedd20af3eade4b8e0cb1dc68444a60c7ef Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Wed, 6 May 2015 17:36:39 +0200 Subject: udevd: worker - allow passing NULL to worker_unref() Signed-off-by: Anthony G. Basile --- src/udev/udevd.c | 3 +-- 1 file changed, 1 insertion(+), 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); -- cgit v1.2.3-54-g00ecf