DPDK patches and discussions
 help / color / mirror / Atom feed
From: Michal Kobylinski <michalx.kobylinski@intel.com>
To: bruce.richardson@intel.com, dev@dpdk.org
Cc: Michal Kobylinski <michalx.kobylinski@intel.com>
Subject: [dpdk-dev] [PATCH] examples/netmap_compat: fix infinite loop
Date: Fri, 22 Apr 2016 12:47:29 +0200	[thread overview]
Message-ID: <1461322049-30416-1-git-send-email-michalx.kobylinski@intel.com> (raw)

Fix issue reported by Coverity.

Coverity ID 30701: Infinite loop: The loop does not have a normal
termination condition, so will continue until an abnormal condition
arises. In rte_netmap_poll: Infinite loop with unsatisfiable exit
condition.

Fixes: 06371afe394d ("examples/netmap_compat: import netmap compatibility example")

Signed-off-by: Michal Kobylinski <michalx.kobylinski@intel.com>
---
 examples/netmap_compat/lib/compat_netmap.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/examples/netmap_compat/lib/compat_netmap.c b/examples/netmap_compat/lib/compat_netmap.c
index bf1b418..8cb5764 100644
--- a/examples/netmap_compat/lib/compat_netmap.c
+++ b/examples/netmap_compat/lib/compat_netmap.c
@@ -865,6 +865,11 @@ rte_netmap_poll(struct pollfd *fds, nfds_t nfds, int timeout)
 	uint32_t i, idx, port;
 	uint32_t want_rx, want_tx;
 
+	if (timeout > 0) {
+		ret = -1;
+		return ret;
+	}
+
 	ret = 0;
 	do {
 		for (i = 0; i < nfds; i++) {
-- 
1.9.1

             reply	other threads:[~2016-04-22 11:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-22 10:47 Michal Kobylinski [this message]
2016-04-22 11:51 ` Mcnamara, John
2016-04-27 13:22 ` [dpdk-dev] [PATCH v2] " Michal Kobylinski
2016-05-16 16:54   ` 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=1461322049-30416-1-git-send-email-michalx.kobylinski@intel.com \
    --to=michalx.kobylinski@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    /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).