From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 91B2E8E7B for ; Fri, 11 Dec 2015 10:52:17 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP; 11 Dec 2015 01:52:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,412,1444719600"; d="scan'208";a="705383012" Received: from dpdk15.sh.intel.com ([10.239.129.25]) by orsmga003.jf.intel.com with ESMTP; 11 Dec 2015 01:52:16 -0800 From: Huawei Xie To: dev@dpdk.org Date: Fri, 11 Dec 2015 01:57:19 +0800 Message-Id: <1449770240-103240-5-git-send-email-huawei.xie@intel.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1449770240-103240-1-git-send-email-huawei.xie@intel.com> References: <1449770240-103240-1-git-send-email-huawei.xie@intel.com> X-Mailman-Approved-At: Fri, 11 Dec 2015 15:22:01 +0100 Subject: [dpdk-dev] [PATCH 3/4] vhost: Fix Coverity issue with missed unlocking X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 09:52:18 -0000 CID 107113 (#1 of 1): Missing unlock (LOCK)5. missing_unlock: Returning without unlocking pfdset->fd_mutex. Fixes: fbf7e07ca142 ("vhost: add select based event driven processing") Signed-off-by: Huawei Xie --- lib/librte_vhost/vhost_user/fd_man.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/librte_vhost/vhost_user/fd_man.c b/lib/librte_vhost/vhost_user/fd_man.c index d68b270..087aaed 100644 --- a/lib/librte_vhost/vhost_user/fd_man.c +++ b/lib/librte_vhost/vhost_user/fd_man.c @@ -150,8 +150,10 @@ fdset_add(struct fdset *pfdset, int fd, fd_cb rcb, fd_cb wcb, void *dat) /* Find a free slot in the list. */ i = fdset_find_free_slot(pfdset); - if (i == -1) + if (i == -1) { + pthread_mutex_unlock(&pfdset->fd_mutex); return -2; + } fdset_add_fd(pfdset, i, fd, rcb, wcb, dat); pfdset->num++; -- 1.8.1.4