DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Xia, Chenbo" <chenbo.xia@intel.com>
To: "Fu, Patrick" <patrick.fu@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>,
	"maxime.coquelin@redhat.com" <maxime.coquelin@redhat.com>
Subject: Re: [dpdk-dev] [PATCH v2] vhost: fix missing null dev pointer check
Date: Fri, 17 Jul 2020 08:08:36 +0000	[thread overview]
Message-ID: <MN2PR11MB406376CC038CED081D2619FF9C7C0@MN2PR11MB4063.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20200716153758.2895041-1-patrick.fu@intel.com>


> -----Original Message-----
> From: Fu, Patrick <patrick.fu@intel.com>
> Sent: Thursday, July 16, 2020 11:38 PM
> To: dev@dpdk.org; maxime.coquelin@redhat.com; Xia, Chenbo
> <chenbo.xia@intel.com>
> Cc: Fu, Patrick <patrick.fu@intel.com>
> Subject: [PATCH v2] vhost: fix missing null dev pointer check
> 
> From: Patrick Fu <patrick.fu@intel.com>
> 
> This patch adds the check of dev pointer in vhost async enqueue completion poll.
> If a NULL dev pointer detected, the poll function returns immediately.
> 
> Coverity issue: 360839
> Fixes: cd6760da1076 ("vhost: introduce async enqueue for split ring")
> 
> Signed-off-by: Patrick Fu <patrick.fu@intel.com>
> ---
> v2:
>   - change fixline number
> 
>  lib/librte_vhost/virtio_net.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c index
> 1d0be3dd4..235c31e28 100644
> --- a/lib/librte_vhost/virtio_net.c
> +++ b/lib/librte_vhost/virtio_net.c
> @@ -1635,6 +1635,9 @@ uint16_t rte_vhost_poll_enqueue_completed(int vid,
> uint16_t queue_id,
>  	uint16_t start_idx, pkts_idx, vq_size;
>  	uint64_t *async_pending_info;
> 
> +	if (!dev)
> +		return 0;
> +
>  	VHOST_LOG_DATA(DEBUG, "(%d) %s\n", dev->vid, __func__);
>  	if (unlikely(!is_valid_virt_queue_idx(queue_id, 0, dev->nr_vring))) {
>  		VHOST_LOG_DATA(ERR, "(%d) %s: invalid virtqueue idx %d.\n",
> --
> 2.18.4

Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>

  reply	other threads:[~2020-07-17  8:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-14  6:00 [dpdk-dev] [PATCH v1] " patrick.fu
2020-07-16 15:37 ` [dpdk-dev] [PATCH v2] " patrick.fu
2020-07-17  8:08   ` Xia, Chenbo [this message]
2020-07-17 13:10     ` Ferruh Yigit
2020-07-20 15:55   ` Maxime Coquelin
2020-07-20 16:49     ` Ferruh Yigit
2020-07-21  3:23 ` [dpdk-dev] [PATCH v3] vhost: fix missing device pointer validity check patrick.fu
2020-07-21  8:36   ` Maxime Coquelin
2020-07-21 14:51     ` Ferruh Yigit

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=MN2PR11MB406376CC038CED081D2619FF9C7C0@MN2PR11MB4063.namprd11.prod.outlook.com \
    --to=chenbo.xia@intel.com \
    --cc=dev@dpdk.org \
    --cc=maxime.coquelin@redhat.com \
    --cc=patrick.fu@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 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).