DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v1] vhost: fix missing null dev pointer check
@ 2020-07-14  6:00 patrick.fu
  2020-07-16 15:37 ` [dpdk-dev] [PATCH v2] " patrick.fu
  2020-07-21  3:23 ` [dpdk-dev] [PATCH v3] vhost: fix missing device pointer validity check patrick.fu
  0 siblings, 2 replies; 9+ messages in thread
From: patrick.fu @ 2020-07-14  6:00 UTC (permalink / raw)
  To: dev, maxime.coquelin, chenbo.xia; +Cc: Patrick Fu

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: cd6760da10 ("vhost: introduce async enqueue for split ring")

Signed-off-by: Patrick Fu <patrick.fu@intel.com>
---
 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


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-07-21 14:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-14  6:00 [dpdk-dev] [PATCH v1] vhost: fix missing null dev pointer check patrick.fu
2020-07-16 15:37 ` [dpdk-dev] [PATCH v2] " patrick.fu
2020-07-17  8:08   ` Xia, Chenbo
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

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).