[dpdk-dev] [PATCH 2/4] net/netvsc: fix invalid rte_free on dev_close
Stephen Hemminger
stephen at networkplumber.org
Tue Apr 28 01:28:20 CEST 2020
The netvsc PMD is putting the mac address in private data.
Unless dev->data->mac_addrs is NULL'd rte_ethdev_close will
try and free the address array.
Causing the following scary error.
EAL: Invalid memory
This is a simpler alternative to the fix already merged in 20.05-rc1
Fixes: f8279f47dd89 ("net/netvsc: fix crash in secondary process")
Cc: stable at dpdk.org
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
drivers/net/netvsc/hn_ethdev.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c
index 05f1a25a1abc..96480f930a46 100644
--- a/drivers/net/netvsc/hn_ethdev.c
+++ b/drivers/net/netvsc/hn_ethdev.c
@@ -849,6 +849,9 @@ hn_dev_close(struct rte_eth_dev *dev)
hn_vf_close(dev);
hn_dev_free_queues(dev);
+
+ /* mac_addrs must not be freed alone because part of dev_private */
+ dev->data->mac_addrs = NULL;
}
static const struct eth_dev_ops hn_eth_dev_ops = {
--
2.20.1
More information about the dev
mailing list