Blame SOURCES/autofs-5.0.7-add-map-entry-null-check-in-do_expire_direct.patch

306fa1
autofs-5.0.7 - add map entry null check in do_expire_direct()
306fa1
306fa1
From: Ian Kent <raven@themaw.net>
306fa1
306fa1
Since we've seen a mount failure for this map entry it should exist
306fa1
but add a null check in case it's been removed while we waited on
306fa1
the lock.
306fa1
---
306fa1
 daemon/direct.c |    3 ++-
306fa1
 1 file changed, 2 insertions(+), 1 deletion(-)
306fa1
306fa1
diff --git a/daemon/direct.c b/daemon/direct.c
306fa1
index 399ad0a..f85e1b5 100644
306fa1
--- a/daemon/direct.c
306fa1
+++ b/daemon/direct.c
306fa1
@@ -1019,7 +1019,8 @@ static void *do_expire_direct(void *arg)
306fa1
 		struct mapent *me;
306fa1
 		cache_writelock(mt.mc);
306fa1
 		me = cache_lookup_distinct(mt.mc, mt.name);
306fa1
-		me->ioctlfd = -1;
306fa1
+		if (me)
306fa1
+			me->ioctlfd = -1;
306fa1
 		cache_unlock(mt.mc);
306fa1
 		ops->send_ready(ap->logopt, mt.ioctlfd, mt.wait_queue_token);
306fa1
 		ops->close(ap->logopt, mt.ioctlfd);