From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anatoly Burakov Subject: [PATCH 2/3] ipc: fix return without mutex unlock Date: Tue, 17 Apr 2018 16:46:25 +0100 Message-ID: References: Cc: thomas@monjalon.net, anatoly.burakov@intel.com To: dev@dpdk.org Return-path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 7D4DCAAB9 for ; Tue, 17 Apr 2018 17:46:31 +0200 (CEST) In-Reply-To: In-Reply-To: References: List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" gettimeofday() returning a negative value is highly unlikely, but if it ever happens, we will exit without unlocking the mutex. Arguably at that point we'll have bigger problems, but fix this issue anyway. Coverity issue: 272595 Fixes: f05e26051c15 ("eal: add IPC asynchronous request") Cc: anatoly.burakov@intel.com Signed-off-by: Anatoly Burakov --- lib/librte_eal/common/eal_common_proc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/librte_eal/common/eal_common_proc.c b/lib/librte_eal/common/eal_common_proc.c index 74bc300..ad02c00 100644 --- a/lib/librte_eal/common/eal_common_proc.c +++ b/lib/librte_eal/common/eal_common_proc.c @@ -525,6 +525,7 @@ async_reply_handle(void *arg __rte_unused) wait_for_async_messages(); if (gettimeofday(&now, NULL) < 0) { + pthread_mutex_unlock(&pending_requests.lock); RTE_LOG(ERR, EAL, "Cannot get current time\n"); break; } -- 2.7.4