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 <jiayu.hu@intel.com> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com> Tested-by: Yinan Wang <yinan.wang@intel.com>
This commit is contained in:
parent
82fc1ea8e3
commit
678a91efa2
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user