DPDK patches and discussions
 help / color / mirror / Atom feed
From: Anatoly Burakov <anatoly.burakov@intel.com>
To: dev@dpdk.org
Cc: thomas@monjalon.net, anatoly.burakov@intel.com
Subject: [dpdk-dev] [PATCH 2/3] ipc: fix return without mutex unlock
Date: Tue, 17 Apr 2018 16:46:25 +0100	[thread overview]
Message-ID: <d219e72dfd1da6d0b674a213b01d65b55ca5058d.1523978461.git.anatoly.burakov@intel.com> (raw)
In-Reply-To: <cover.1523978461.git.anatoly.burakov@intel.com>
In-Reply-To: <cover.1523978461.git.anatoly.burakov@intel.com>

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 <anatoly.burakov@intel.com>
---
 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

  parent reply	other threads:[~2018-04-17 15:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-17 15:46 [dpdk-dev] [PATCH 0/3] Coverity fixes for DPDK IPC Anatoly Burakov
2018-04-17 15:46 ` [dpdk-dev] [PATCH 1/3] ipc: use strlcpy where applicable Anatoly Burakov
2018-04-17 15:46 ` Anatoly Burakov [this message]
2018-04-17 15:46 ` [dpdk-dev] [PATCH 3/3] ipc: fix resource leak Anatoly Burakov
2018-04-20 14:40 ` [dpdk-dev] [PATCH 0/3] Coverity fixes for DPDK IPC Tan, Jianfeng
2018-04-23 20:34   ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d219e72dfd1da6d0b674a213b01d65b55ca5058d.1523978461.git.anatoly.burakov@intel.com \
    --to=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).