vhost: Move mutex initialization after possible failure paths

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I428027e13f2426684cff536430423d2e4953e29b
Reviewed-on: https://review.gerrithub.io/433824
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
This commit is contained in:
Maciej Szwed 2018-11-19 11:22:29 +01:00 committed by Changpeng Liu
parent 65724c3f88
commit b86e1be001

View File

@ -640,7 +640,6 @@ rte_vhost_driver_register(const char *path, uint64_t flags)
goto out;
}
TAILQ_INIT(&vsocket->conn_list);
pthread_mutex_init(&vsocket->conn_mutex, NULL);
vsocket->dequeue_zero_copy = flags & RTE_VHOST_USER_DEQUEUE_ZERO_COPY;
/*
@ -677,6 +676,7 @@ rte_vhost_driver_register(const char *path, uint64_t flags)
goto out;
}
pthread_mutex_init(&vsocket->conn_mutex, NULL);
vhost_user.vsockets[vhost_user.vsocket_cnt++] = vsocket;
out: