From: Yuanhan Liu Subject: [PATCH] vhost: fix use after free Date: Mon, 17 Apr 2017 15:27:04 +0800 Message-ID: <1492414024-18413-1-git-send-email-yuanhan.liu@linux.intel.com> Cc: Maxime Coquelin , Yuanhan Liu To: dev@dpdk.org Return-path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 3E1BA58FE for ; Mon, 17 Apr 2017 09:30:07 +0200 (CEST) List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" A "return" is missing on error, which could lead to a "use after free" issue (about var "conn"). Fixes: 65388b43f592 ("vhost: fix fd leaks for vhost-user server mode") Coverity issue: 143476 Reported-by: John McNamara Signed-off-by: Yuanhan Liu --- lib/librte_vhost/socket.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c index 66fd335..c7f99b0 100644 --- a/lib/librte_vhost/socket.c +++ b/lib/librte_vhost/socket.c @@ -242,6 +242,7 @@ struct vhost_user { RTE_LOG(ERR, VHOST_CONFIG, "failed to add fd %d into vhost server fdset\n", fd); + return; } pthread_mutex_lock(&vsocket->conn_mutex); -- 1.9.0