[2/4] net/netvsc: fix invalid rte_free on dev_close
Checks
Commit Message
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@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/netvsc/hn_ethdev.c | 3 +++
1 file changed, 3 insertions(+)
@@ -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 = {