From: Jiayu Hu Date: Tue, 20 Apr 2021 08:57:43 +0000 (-0400) Subject: vhost: fix queue initialization X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=678a91efa23a50a16cd3c5a2b18a117daef3c840;p=dpdk.git vhost: fix queue initialization This patch allocates vhost queue by rte_zmalloc() to avoid undefined values. Fixes: a277c7159876 ("vhost: refactor code structure") Cc: stable@dpdk.org Signed-off-by: Jiayu Hu Reviewed-by: Maxime Coquelin Tested-by: Yinan Wang --- diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c index a70fe01d8f..ea38cf2b75 100644 --- a/lib/vhost/vhost.c +++ b/lib/vhost/vhost.c @@ -608,7 +608,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);