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

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