virtio: fix size of MAC address array
[dpdk.git] / drivers / net / virtio / virtio_ethdev.c
index 2ba7dea..6001108 100644 (file)
@@ -1279,11 +1279,11 @@ eth_virtio_dev_init(struct rte_eth_dev *eth_dev)
        }
 
        /* Allocate memory for storing MAC addresses */
-       eth_dev->data->mac_addrs = rte_zmalloc("virtio", ETHER_ADDR_LEN, 0);
+       eth_dev->data->mac_addrs = rte_zmalloc("virtio", VIRTIO_MAX_MAC_ADDRS * ETHER_ADDR_LEN, 0);
        if (eth_dev->data->mac_addrs == NULL) {
                PMD_INIT_LOG(ERR,
                        "Failed to allocate %d bytes needed to store MAC addresses",
-                       ETHER_ADDR_LEN);
+                       VIRTIO_MAX_MAC_ADDRS * ETHER_ADDR_LEN);
                return -ENOMEM;
        }