vhost: fix initialization

Exception handling is executed in the normal path and it will cause
vhost-user init failure.

Fixes: d6983a70e2 ("vhost: check return of pthread calls")

Reported-by: Lei Yao <lei.a.yao@intel.com>
Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
Tested-by: Lei Yao <lei.a.yao@intel.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
This commit is contained in:
Zhiyong Yang 2017-07-10 16:06:48 +08:00 committed by Yuanhan Liu
parent 39f403e0d5
commit 78b2e3bae1

View File

@ -669,6 +669,9 @@ rte_vhost_driver_register(const char *path, uint64_t flags)
vhost_user.vsockets[vhost_user.vsocket_cnt++] = vsocket;
pthread_mutex_unlock(&vhost_user.mutex);
return ret;
out_mutex:
if (pthread_mutex_destroy(&vsocket->conn_mutex)) {
RTE_LOG(ERR, VHOST_CONFIG,