From: Yuanhan Liu Date: Fri, 20 Jan 2017 08:04:53 +0000 (+0800) Subject: ethdev: fix data reset when allocating port X-Git-Tag: spdx-start~4682 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=61207d014fc906302a184ae2f779b54ccfd0cd4c;p=dpdk.git ethdev: fix data reset when allocating port Fix an silly error by auto-complete while managing the merge conflicts. It's the eth_dev_data (but not eth_dev) entry should be memset. Fixes: d948f596fee2 ("ethdev: fix port data mismatched in multiple process model") Reported-by: Ferruh Yigit Signed-off-by: Yuanhan Liu --- diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 4790fafa4f..61f44e218a 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -225,7 +225,7 @@ rte_eth_dev_allocate(const char *name) return NULL; } - memset(&rte_eth_devices[port_id], 0, sizeof(*eth_dev->data)); + memset(&rte_eth_dev_data[port_id], 0, sizeof(struct rte_eth_dev_data)); eth_dev = eth_dev_get(port_id); snprintf(eth_dev->data->name, sizeof(eth_dev->data->name), "%s", name); eth_dev->data->port_id = port_id;