Windows: cm_ConnByServer add conn to list after init

Do not add a newly created cm_conn_t to the cm_server_t connsp
list until after the object is fully initialized.

Change-Id: Ic5605abefb51d9342f0d249903e13e99b90452b7
Reviewed-on: http://gerrit.openafs.org/7717
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
This commit is contained in:
Jeffrey Altman 2012-07-05 14:33:50 -04:00
parent f73aebbe87
commit c3ce54e6b7

View File

@ -1584,17 +1584,15 @@ long cm_ConnByServer(cm_server_t *serverp, cm_user_t *userp, afs_uint32 replicat
cm_GetServer(serverp);
tcp = malloc(sizeof(*tcp));
memset(tcp, 0, sizeof(*tcp));
tcp->nextp = serverp->connsp;
serverp->connsp = tcp;
cm_HoldUser(userp);
tcp->userp = userp;
lock_InitializeMutex(&tcp->mx, "cm_conn_t mutex", LOCK_HIERARCHY_CONN);
lock_ObtainMutex(&tcp->mx);
tcp->serverp = serverp;
tcp->cryptlevel = rxkad_clear;
cm_NewRXConnection(tcp, ucellp, serverp, replicated);
tcp->refCount = 1;
lock_ReleaseMutex(&tcp->mx);
tcp->nextp = serverp->connsp;
serverp->connsp = tcp;
lock_ReleaseWrite(&cm_connLock);
} else {
lock_ReleaseRead(&cm_connLock);