DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v1] vhost: set zmbufs to NULL when freed
@ 2020-07-15 15:58 patrick.fu
  2020-07-16  8:23 ` Xiao, QimaiX
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: patrick.fu @ 2020-07-15 15:58 UTC (permalink / raw)
  To: dev, maxime.coquelin, chenbo.xia; +Cc: yinan.wang, Patrick Fu

From: Patrick Fu <patrick.fu@intel.com>

zmbufs should be set to NULL when getting freed to avoid double free on
the same buffer pointer

Fixes: b0a985d1f340 ("vhost: add dequeue zero copy")

Signed-off-by: Patrick Fu <patrick.fu@intel.com>
---
 lib/librte_vhost/vhost_user.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
index df0db8a07..9ddeae362 100644
--- a/lib/librte_vhost/vhost_user.c
+++ b/lib/librte_vhost/vhost_user.c
@@ -1934,6 +1934,7 @@ free_zmbufs(struct vhost_virtqueue *vq)
 	drain_zmbuf_list(vq);
 
 	rte_free(vq->zmbufs);
+	vq->zmbufs = NULL;
 }
 
 /*
-- 
2.17.1


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

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

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-15 15:58 [dpdk-dev] [PATCH v1] vhost: set zmbufs to NULL when freed patrick.fu
2020-07-16  8:23 ` Xiao, QimaiX
2020-07-17  3:19 ` Xia, Chenbo
2020-07-17 12:35   ` Ferruh Yigit
2020-07-20 15:51 ` Maxime Coquelin
2020-07-20 16:49   ` Ferruh Yigit
2020-07-21  3:18   ` Fu, Patrick
2020-07-21 12:10 ` [dpdk-dev] [PATCH v2] vhost: fix double-free with zero-copy patrick.fu
2020-07-21  9:16   ` Maxime Coquelin
2020-07-21 14:58     ` Ferruh Yigit

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git