From: Kuba Kozak Date: Fri, 22 Sep 2017 12:17:40 +0000 (+0200) Subject: vhost: check poll error code X-Git-Tag: spdx-start~1634 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=66a62101240bb714a6d2d5acd39010675251ffec;p=dpdk.git vhost: check poll error code Add return value check for poll() call. Coverity issue: 140740 Fixes: 59317cef249c ("vhost: allow many vhost-user ports") Cc: stable@dpdk.org Signed-off-by: Kuba Kozak Acked-by: Yuanhan Liu --- diff --git a/lib/librte_vhost/fd_man.c b/lib/librte_vhost/fd_man.c index 2ceacc9abd..4c6fed4189 100644 --- a/lib/librte_vhost/fd_man.c +++ b/lib/librte_vhost/fd_man.c @@ -222,6 +222,7 @@ fdset_event_dispatch(void *arg) int remove1, remove2; int need_shrink; struct fdset *pfdset = arg; + int val; if (pfdset == NULL) return NULL; @@ -239,7 +240,9 @@ fdset_event_dispatch(void *arg) numfds = pfdset->num; pthread_mutex_unlock(&pfdset->fd_mutex); - poll(pfdset->rwfds, numfds, 1000 /* millisecs */); + val = poll(pfdset->rwfds, numfds, 1000 /* millisecs */); + if (val < 0) + continue; need_shrink = 0; for (i = 0; i < numfds; i++) {