All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: Chenbo Xia <chenbo.xia@intel.com>, dev@dpdk.org
Cc: zhihong.wang@intel.com, stable@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v1] net/virtio-user: fix return value check
Date: Wed, 29 Jul 2020 16:22:31 +0200	[thread overview]
Message-ID: <98f4f945-62f0-1c62-273e-d932ad546d99@redhat.com> (raw)
In-Reply-To: <20200729131230.14847-1-chenbo.xia@intel.com>



On 7/29/20 3:12 PM, Chenbo Xia wrote:
> Setting the flags of tapfd may fail and the return value
> should be checked.
> 
> Coverity issue: 140739
> Fixes: e3b434818bbb ("net/virtio-user: support kernel vhost")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
> ---
>  drivers/net/virtio/virtio_user/vhost_kernel_tap.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/virtio/virtio_user/vhost_kernel_tap.c b/drivers/net/virtio/virtio_user/vhost_kernel_tap.c
> index 2fa4f0d66..acddefa33 100644
> --- a/drivers/net/virtio/virtio_user/vhost_kernel_tap.c
> +++ b/drivers/net/virtio/virtio_user/vhost_kernel_tap.c
> @@ -128,7 +128,10 @@ vhost_kernel_open_tap(char **p_ifname, int hdr_size, int req_mq,
>  		goto error;
>  	}
>  
> -	fcntl(tapfd, F_SETFL, O_NONBLOCK);
> +	if (fcntl(tapfd, F_SETFL, O_NONBLOCK) < 0) {
> +		PMD_DRV_LOG(ERR, "fcntl tapfd failed: %s", strerror(errno));
> +		goto error;
> +	}
>  
>  	if (ioctl(tapfd, TUNSETVNETHDRSZ, &hdr_size) < 0) {
>  		PMD_DRV_LOG(ERR, "TUNSETVNETHDRSZ failed: %s", strerror(errno));
> 

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime


  reply	other threads:[~2020-07-29 14:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-29 13:12 [dpdk-dev] [PATCH v1] net/virtio-user: fix return value check Chenbo Xia
2020-07-29 14:22 ` Maxime Coquelin [this message]
2020-07-29 14:54 ` Maxime Coquelin
  -- strict thread matches above, loose matches on Subject: below --
2019-04-10  2:44 Chenbo Xia
2019-04-10  4:37 ` Rami Rosen
2019-04-10 15:18 ` Jens Freimann
2019-04-12  4:16 ` Tiwei Bie
2019-04-17  7:56 ` Maxime Coquelin

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=98f4f945-62f0-1c62-273e-d932ad546d99@redhat.com \
    --to=maxime.coquelin@redhat.com \
    --cc=chenbo.xia@intel.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    --cc=zhihong.wang@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.