From 7fb78765aacbef7ac1024d03ffa5fd5d35e42568 Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Thu, 7 Sep 2017 09:56:28 -0700 Subject: [PATCH] rte_vhost: fix numa_realloc() copy size The rte_malloc_socket() call just above that allocates vq is only allocating sizeof(*vq), but the memcpy() would have tried to copy sizeof(*vq) * 2. This code is under #ifdef RTE_LIBRTE_VHOST_NUMA, so it was not normally enabled with DPDK 17.05, but it breaks when DPDK 17.08 turns on libnuma support by default. Change-Id: I75c0c8666a9147346038d313fb419350988d8187 Signed-off-by: Daniel Verkamp Reviewed-on: https://review.gerrithub.io/377596 Tested-by: SPDK Automated Test System Reviewed-by: John Kariuki Reviewed-by: Jim Harris --- lib/vhost/rte_vhost/vhost_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vhost/rte_vhost/vhost_user.c b/lib/vhost/rte_vhost/vhost_user.c index e2e5e5439..654f3979b 100644 --- a/lib/vhost/rte_vhost/vhost_user.c +++ b/lib/vhost/rte_vhost/vhost_user.c @@ -275,7 +275,7 @@ numa_realloc(struct virtio_net *dev, int index) if (!vq) return dev; - memcpy(vq, old_vq, sizeof(*vq) * VIRTIO_QNUM); + memcpy(vq, old_vq, sizeof(*vq)); rte_free(old_vq); }