summaryrefslogtreecommitdiff
path: root/examples/netmap_compat
diff options
context:
space:
mode:
authorMichal Kobylinski <michalx.kobylinski@intel.com>2016-04-27 15:22:41 +0200
committerThomas Monjalon <thomas.monjalon@6wind.com>2016-05-16 21:01:51 +0200
commit30e1c9fab9fb00537816f5ee94f3f109ad33eedb (patch)
tree2b93bfe4a8d6b923781207ec7c59d8c1c821c214 /examples/netmap_compat
parente752649c5b558daa2fb3d19d49664a79a6c3133c (diff)
downloaddpdk-draft-windows-30e1c9fab9fb00537816f5ee94f3f109ad33eedb.zip
dpdk-draft-windows-30e1c9fab9fb00537816f5ee94f3f109ad33eedb.tar.gz
dpdk-draft-windows-30e1c9fab9fb00537816f5ee94f3f109ad33eedb.tar.xz
examples/netmap_compat: fix infinite loop
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. Coverity issue: 30701 Fixes: 06371afe ("examples/netmap_compat: import netmap compatibility example") Signed-off-by: Michal Kobylinski <michalx.kobylinski@intel.com>
Diffstat (limited to 'examples/netmap_compat')
-rw-r--r--examples/netmap_compat/lib/compat_netmap.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/examples/netmap_compat/lib/compat_netmap.c b/examples/netmap_compat/lib/compat_netmap.c
index bf1b418..112c551 100644
--- a/examples/netmap_compat/lib/compat_netmap.c
+++ b/examples/netmap_compat/lib/compat_netmap.c
@@ -865,6 +865,9 @@ 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)
+ return -1;
+
ret = 0;
do {
for (i = 0; i < nfds; i++) {