From 78b2e3bae1af7fc8b9994193ff90846fa5520eb7 Mon Sep 17 00:00:00 2001 From: Zhiyong Yang Date: Mon, 10 Jul 2017 16:06:48 +0800 Subject: [PATCH] vhost: fix initialization Exception handling is executed in the normal path and it will cause vhost-user init failure. Fixes: d6983a70e259 ("vhost: check return of pthread calls") Reported-by: Lei Yao Signed-off-by: Zhiyong Yang Tested-by: Lei Yao Reviewed-by: Jens Freimann Reviewed-by: Maxime Coquelin --- lib/librte_vhost/socket.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c index 57b86c0174..41aa3f9b2b 100644 --- a/lib/librte_vhost/socket.c +++ b/lib/librte_vhost/socket.c @@ -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, -- 2.20.1