From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 052D4A0540; Wed, 15 Jul 2020 09:06:02 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AFB941BFD4; Wed, 15 Jul 2020 09:06:01 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id B47971BFC5 for ; Wed, 15 Jul 2020 09:05:59 +0200 (CEST) IronPort-SDR: hkfsDioPJcGtSz/oSd/x0Z6ZEuGRB50QTJRXspzmVX8Y9CbQAuf6UhS5c9HO4p7imyE/9bDu/i JAS62Dl3dVQw== X-IronPort-AV: E=McAfee;i="6000,8403,9682"; a="210640749" X-IronPort-AV: E=Sophos;i="5.75,354,1589266800"; d="scan'208";a="210640749" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jul 2020 00:05:58 -0700 IronPort-SDR: /ces7b9A4nVFGNgXu00yNWt0DOj3ZNPXi4Ku83r/sfVz4ac2VsYZBunJeGt657kmx330wlcuEK mVCmcGAmXUuA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,354,1589266800"; d="scan'208";a="486147990" Received: from npg-dpdk-patrickfu-casc1.sh.intel.com ([10.67.111.105]) by fmsmga005.fm.intel.com with ESMTP; 15 Jul 2020 00:05:47 -0700 From: patrick.fu@intel.com To: dev@dpdk.org, maxime.coquelin@redhat.com, chenbo.xia@intel.com Cc: yinan.wang@intel.com, Patrick Fu Date: Wed, 15 Jul 2020 15:58:48 +0000 Message-Id: <20200715155848.9501-1-patrick.fu@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH v1] vhost: set zmbufs to NULL when freed X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Patrick Fu 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 --- 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