ucma_ib_init() does a quick check that access to ibacm has
been initialized. This check is done outside of the
acm_lock mutex. We need to check init again inside of
holding the mutex to ensure that we don't run the
initialization code twice.
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
return;
pthread_mutex_lock(&acm_lock);
+ if (init)
+ goto unlock;
+
if (!ucma_set_server_port())
goto out;
}
out:
init = 1;
+unlock:
pthread_mutex_unlock(&acm_lock);
}