From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 09F9E1B229; Mon, 2 Oct 2017 16:18:09 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga104.jf.intel.com with ESMTP; 02 Oct 2017 07:18:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,469,1500966000"; d="scan'208";a="1177784790" Received: from irsmsx104.ger.corp.intel.com ([163.33.3.159]) by orsmga001.jf.intel.com with ESMTP; 02 Oct 2017 07:18:07 -0700 Received: from irsmsx109.ger.corp.intel.com ([169.254.13.28]) by IRSMSX104.ger.corp.intel.com ([163.33.3.159]) with mapi id 14.03.0319.002; Mon, 2 Oct 2017 15:18:06 +0100 From: "Jastrzebski, MichalX K" To: "Kozak, KubaX" , "yliu@fridaylinux.org" , "maxime.coquelin@redhat.com" CC: "dev@dpdk.org" , "Kozak, KubaX" , "jan.wickbom@ericsson.com" , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] vhost: fix unchecked return value Thread-Index: AQHTM54NzoT5gfRgAUWXTXldtRjJ9KLQqxLA Date: Mon, 2 Oct 2017 14:18:05 +0000 Message-ID: <60ABE07DBB3A454EB7FAD707B4BB158213C40FC4@IRSMSX109.ger.corp.intel.com> References: <1506082660-46479-1-git-send-email-kubax.kozak@intel.com> In-Reply-To: <1506082660-46479-1-git-send-email-kubax.kozak@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZmQ5ODczMTYtY2Y2Mi00MTNjLWE2ODItNGY0ZGRlYmQxZjE5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IkNSUFJDS1ZVd3V2N3c5WXJTdnJlZmFnNUJCZ2dUQzc2U20xb2lFcWZGaEE9In0= x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] vhost: fix unchecked return value X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2017 14:18:10 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Kuba Kozak > Sent: Friday, September 22, 2017 2:18 PM > To: yliu@fridaylinux.org; maxime.coquelin@redhat.com > Cc: dev@dpdk.org; Kozak, KubaX ; > jan.wickbom@ericsson.com; stable@dpdk.org > Subject: [dpdk-dev] [PATCH] vhost: fix unchecked return value >=20 > Add return value check for poll() call. >=20 > Coverity issue: 140740 > Fixes: 59317cef249c ("vhost: allow many vhost-user ports") > Cc: jan.wickbom@ericsson.com > Cc: stable@dpdk.org >=20 > Signed-off-by: Kuba Kozak > --- > lib/librte_vhost/fd_man.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) >=20 > diff --git a/lib/librte_vhost/fd_man.c b/lib/librte_vhost/fd_man.c > index 2ceacc9..4c6fed4 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 =3D arg; > + int val; >=20 > if (pfdset =3D=3D NULL) > return NULL; > @@ -239,7 +240,9 @@ fdset_event_dispatch(void *arg) > numfds =3D pfdset->num; > pthread_mutex_unlock(&pfdset->fd_mutex); >=20 > - poll(pfdset->rwfds, numfds, 1000 /* millisecs */); > + val =3D poll(pfdset->rwfds, numfds, 1000 /* millisecs */); > + if (val < 0) > + continue; >=20 > need_shrink =3D 0; > for (i =3D 0; i < numfds; i++) { > -- > 2.7.4 Hi Yu / Maxime, I would like to ask for a feedback regarding proposed fix. If everything is ok with it, please send acked-by. Best regards Michal.