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

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