From: Michal Kobylinski Date: Wed, 27 Apr 2016 13:22:41 +0000 (+0200) Subject: examples/netmap_compat: fix infinite loop X-Git-Tag: spdx-start~6915 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=30e1c9fab9fb00537816f5ee94f3f109ad33eedb;p=dpdk.git 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 --- diff --git a/examples/netmap_compat/lib/compat_netmap.c b/examples/netmap_compat/lib/compat_netmap.c index bf1b418afe..112c551f14 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++) {