diff --git a/lib/context.c b/lib/context.c
index 9f221f5..207b032 100644
--- a/lib/context.c
+++ b/lib/context.c
@@ -1109,7 +1109,7 @@ lws_create_context(struct lws_context_creation_info *info)
 
 #if LWS_MAX_SMP > 1
 	/* each thread serves his own chunk of fds */
-	for (n = 1; n < (int)info->count_threads; n++)
+	for (n = 1; n < (int)context->count_threads; n++)
 		context->pt[n].fds = context->pt[n - 1].fds +
 				     context->fd_limit_per_thread;
 #endif
