patches for DPDK stable branches
 help / color / mirror / Atom feed
From: "Tan, Jianfeng" <jianfeng.tan@intel.com>
To: "Basierski, SebastianX" <sebastianx.basierski@intel.com>,
	"yliu@fridaylinux.org" <yliu@fridaylinux.org>
Cc: "dev@dpdk.org" <dev@dpdk.org>, "stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-stable] [PATCH v2] Report an error message if the flag O_NONBLOCK setting fails, then return from function.
Date: Tue, 24 Oct 2017 07:26:54 +0000	[thread overview]
Message-ID: <ED26CBA2FAD1BF48A8719AEF02201E36513264AB@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <1508821844-37372-2-git-send-email-sebastianx.basierski@intel.com>



> -----Original Message-----
> From: Basierski, SebastianX
> Sent: Tuesday, October 24, 2017 1:11 PM
> To: yliu@fridaylinux.org
> Cc: dev@dpdk.org; Basierski, SebastianX; Tan, Jianfeng; stable@dpdk.org
> Subject: [PATCH v2] Report an error message if the flag O_NONBLOCK
> setting fails, then return from function.
> 
> Coverity issue: 143439
> 
> Fixes: ef53b6030039 ("net/virtio-user: support LSC")
> Cc: jianfeng.tan@intel.com
> cc: stable@dpdk.org
> 
> Signed-off-by: SebastianX Basierski <sebastianx.basierski@intel.com>

Except a nit below,
Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>


> ---
>  drivers/net/virtio/virtio_user_ethdev.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/virtio/virtio_user_ethdev.c
> b/drivers/net/virtio/virtio_user_ethdev.c
> index 57c964d..fe3a7be 100644
> --- a/drivers/net/virtio/virtio_user_ethdev.c
> +++ b/drivers/net/virtio/virtio_user_ethdev.c
> @@ -86,7 +86,11 @@ virtio_user_read_dev_config(struct virtio_hw *hw,
> size_t offset,
>  			int flags;
> 
>  			flags = fcntl(dev->vhostfd, F_GETFL);
> -			fcntl(dev->vhostfd, F_SETFL, flags | O_NONBLOCK);
> +			if (fcntl(dev->vhostfd, F_SETFL,
> +					flags | O_NONBLOCK) == -1){

There should be a space between ")" and "{".


> +				PMD_DRV_LOG(ERR, "error setting
> O_NONBLOCK flag");
> +				return;
> +			}
>  			r = recv(dev->vhostfd, buf, 128, MSG_PEEK);
>  			if (r == 0 || (r < 0 && errno != EAGAIN)) {
>  				dev->status &= (~VIRTIO_NET_S_LINK_UP);
> --
> 2.7.4

  reply	other threads:[~2017-10-24  7:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1505821646-33594-1-git-send-email-sebastianx.basierski@intel.com>
     [not found] ` <1508821844-37372-1-git-send-email-sebastianx.basierski@intel.com>
2017-10-24  5:10   ` SebastianX Basierski
2017-10-24  7:26     ` Tan, Jianfeng [this message]
2017-10-24  8:17     ` [dpdk-stable] [PATCH v3] net/virtio: fix unchecked return value SebastianX Basierski
2017-10-24  8:40       ` Yuanhan Liu
2017-10-24  8:20     ` SebastianX Basierski

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=ED26CBA2FAD1BF48A8719AEF02201E36513264AB@SHSMSX103.ccr.corp.intel.com \
    --to=jianfeng.tan@intel.com \
    --cc=dev@dpdk.org \
    --cc=sebastianx.basierski@intel.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).