From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id BFC65A49; Mon, 6 May 2019 15:11:23 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CA628308623A; Mon, 6 May 2019 13:11:22 +0000 (UTC) Received: from dhcp-25.97.bos.redhat.com (ovpn-124-136.rdu2.redhat.com [10.10.124.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0D12319C4F; Mon, 6 May 2019 13:11:21 +0000 (UTC) From: Aaron Conole To: dev@dpdk.org Cc: Herakliusz Lipiec , stable@dpdk.org, Anatoly Burakov , David Marchand Date: Mon, 6 May 2019 09:11:20 -0400 Message-Id: <20190506131120.25140-1-aconole@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Mon, 06 May 2019 13:11:22 +0000 (UTC) Subject: [dpdk-dev] [PATCH] ipc: unlock on failure X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 13:11:24 -0000 Reported by Coverity. Fixes: a2a06860b8c4 ("ipc: fix memory leak on request failure") Cc: Herakliusz Lipiec Cc: stable@dpdk.org Cc: Anatoly Burakov Signed-off-by: Aaron Conole --- lib/librte_eal/common/eal_common_proc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/librte_eal/common/eal_common_proc.c b/lib/librte_eal/common/eal_common_proc.c index d23728604..3498e6b07 100644 --- a/lib/librte_eal/common/eal_common_proc.c +++ b/lib/librte_eal/common/eal_common_proc.c @@ -1005,8 +1005,10 @@ rte_mp_request_sync(struct rte_mp_msg *req, struct rte_mp_reply *reply, /* unlocks the mutex while waiting for response, * locks on receive */ - if (mp_request_sync(path, req, reply, &end)) + if (mp_request_sync(path, req, reply, &end)) { + pthread_mutex_unlock(&pending_requests.lock); goto err; + } } pthread_mutex_unlock(&pending_requests.lock); /* unlock the directory */ -- 2.19.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 9900BA0096 for ; Mon, 6 May 2019 15:11:26 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E151E374C; Mon, 6 May 2019 15:11:24 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id BFC65A49; Mon, 6 May 2019 15:11:23 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CA628308623A; Mon, 6 May 2019 13:11:22 +0000 (UTC) Received: from dhcp-25.97.bos.redhat.com (ovpn-124-136.rdu2.redhat.com [10.10.124.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0D12319C4F; Mon, 6 May 2019 13:11:21 +0000 (UTC) From: Aaron Conole To: dev@dpdk.org Cc: Herakliusz Lipiec , stable@dpdk.org, Anatoly Burakov , David Marchand Date: Mon, 6 May 2019 09:11:20 -0400 Message-Id: <20190506131120.25140-1-aconole@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Mon, 06 May 2019 13:11:22 +0000 (UTC) Subject: [dpdk-dev] [PATCH] ipc: unlock on failure X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Content-Type: text/plain; charset="UTF-8" Message-ID: <20190506131120.PMWCm553L-tlBH5lxPRQFMje_mJcVymPTF81vVX9rpw@z> Reported by Coverity. Fixes: a2a06860b8c4 ("ipc: fix memory leak on request failure") Cc: Herakliusz Lipiec Cc: stable@dpdk.org Cc: Anatoly Burakov Signed-off-by: Aaron Conole --- lib/librte_eal/common/eal_common_proc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/librte_eal/common/eal_common_proc.c b/lib/librte_eal/common/eal_common_proc.c index d23728604..3498e6b07 100644 --- a/lib/librte_eal/common/eal_common_proc.c +++ b/lib/librte_eal/common/eal_common_proc.c @@ -1005,8 +1005,10 @@ rte_mp_request_sync(struct rte_mp_msg *req, struct rte_mp_reply *reply, /* unlocks the mutex while waiting for response, * locks on receive */ - if (mp_request_sync(path, req, reply, &end)) + if (mp_request_sync(path, req, reply, &end)) { + pthread_mutex_unlock(&pending_requests.lock); goto err; + } } pthread_mutex_unlock(&pending_requests.lock); /* unlock the directory */ -- 2.19.1