DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] examples/netmap_compat: fix infinite loop
@ 2016-04-22 10:47 Michal Kobylinski
  2016-04-22 11:51 ` Mcnamara, John
  2016-04-27 13:22 ` [dpdk-dev] [PATCH v2] " Michal Kobylinski
  0 siblings, 2 replies; 4+ messages in thread
From: Michal Kobylinski @ 2016-04-22 10:47 UTC (permalink / raw)
  To: bruce.richardson, dev; +Cc: Michal Kobylinski

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-05-16 16:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-22 10:47 [dpdk-dev] [PATCH] examples/netmap_compat: fix infinite loop Michal Kobylinski
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

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).