From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id EC612A00C2; Wed, 17 Mar 2021 07:26:31 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 57641242AFA; Wed, 17 Mar 2021 07:26:28 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 1C6FE40689 for ; Wed, 17 Mar 2021 07:26:25 +0100 (CET) IronPort-SDR: 0Cji/DYhy1+r11cpsOUAM5fGrBE8i0XM6P1BjR/BhZLfcB41JJLpvk1i5MymSFVHRsIKEfyRbT GN9oIpZNAUXQ== X-IronPort-AV: E=McAfee;i="6000,8403,9925"; a="186041209" X-IronPort-AV: E=Sophos;i="5.81,255,1610438400"; d="scan'208";a="186041209" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Mar 2021 23:26:25 -0700 IronPort-SDR: FvWmRdYZW71PO7fHq6Xmwf8kMSLLEvYyzp6ebqONjxTZ5INprHcEsXgZ52xc9jiQfzye44xWmW uFeiohp2h6bw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,255,1610438400"; d="scan'208";a="433282863" Received: from npg_dpdk_virtio_jiayuhu_07.sh.intel.com ([10.67.118.193]) by fmsmga004.fm.intel.com with ESMTP; 16 Mar 2021 23:26:23 -0700 From: Jiayu Hu To: dev@dpdk.org Cc: maxime.coquelin@redhat.com, chenbo.xia@intel.com, yinan.wang@intel.com, cheng1.jiang@intel.com, sunil.pai.g@intel.com, Jiayu Hu Date: Wed, 17 Mar 2021 08:56:10 -0400 Message-Id: <1615985773-406787-2-git-send-email-jiayu.hu@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1615985773-406787-1-git-send-email-jiayu.hu@intel.com> References: <1615985773-406787-1-git-send-email-jiayu.hu@intel.com> Subject: [dpdk-dev] [PATCH 1/4] vhost: fix uninitialized vhost queue X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" This patch allocates vhost queue by rte_zmalloc() to avoid undefined values. Fixes: 8acd7c213353 ("vhost: fix virtqueues metadata allocation") Signed-off-by: Jiayu Hu --- lib/librte_vhost/vhost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c index 52ab93d..f6fd001 100644 --- a/lib/librte_vhost/vhost.c +++ b/lib/librte_vhost/vhost.c @@ -598,7 +598,7 @@ alloc_vring_queue(struct virtio_net *dev, uint32_t vring_idx) if (dev->virtqueue[i]) continue; - vq = rte_malloc(NULL, sizeof(struct vhost_virtqueue), 0); + vq = rte_zmalloc(NULL, sizeof(struct vhost_virtqueue), 0); if (vq == NULL) { VHOST_LOG_CONFIG(ERR, "Failed to allocate memory for vring:%u.\n", i); -- 2.7.4