patches for DPDK stable branches
 help / color / mirror / Atom feed
From: "Jastrzebski, MichalX K" <michalx.k.jastrzebski@intel.com>
To: "Kozak, KubaX" <kubax.kozak@intel.com>,
	"yliu@fridaylinux.org" <yliu@fridaylinux.org>,
	"maxime.coquelin@redhat.com" <maxime.coquelin@redhat.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	"Kozak, KubaX" <kubax.kozak@intel.com>,
	"jan.wickbom@ericsson.com" <jan.wickbom@ericsson.com>,
	"stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] vhost: fix unchecked return value
Date: Mon, 2 Oct 2017 14:18:05 +0000	[thread overview]
Message-ID: <60ABE07DBB3A454EB7FAD707B4BB158213C40FC4@IRSMSX109.ger.corp.intel.com> (raw)
In-Reply-To: <1506082660-46479-1-git-send-email-kubax.kozak@intel.com>

> -----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 <kubax.kozak@intel.com>;
> jan.wickbom@ericsson.com; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] vhost: fix unchecked return value
> 
> Add return value check for poll() call.
> 
> Coverity issue: 140740
> Fixes: 59317cef249c ("vhost: allow many vhost-user ports")
> Cc: jan.wickbom@ericsson.com
> Cc: stable@dpdk.org
> 
> Signed-off-by: Kuba Kozak <kubax.kozak@intel.com>
> ---
>  lib/librte_vhost/fd_man.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> 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 = 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++) {
> --
> 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.

  reply	other threads:[~2017-10-02 14:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-22 12:17 [dpdk-stable] " Kuba Kozak
2017-10-02 14:18 ` Jastrzebski, MichalX K [this message]
2017-10-09  3:10 ` Yuanhan Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=60ABE07DBB3A454EB7FAD707B4BB158213C40FC4@IRSMSX109.ger.corp.intel.com \
    --to=michalx.k.jastrzebski@intel.com \
    --cc=dev@dpdk.org \
    --cc=jan.wickbom@ericsson.com \
    --cc=kubax.kozak@intel.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=stable@dpdk.org \
    --cc=yliu@fridaylinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).