From: Allain Legacy Date: Fri, 23 Jun 2017 12:41:37 +0000 (-0400) Subject: net/virtio-user: fix crash when detaching device X-Git-Tag: spdx-start~2705 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=2a7b7d837ff70b6a58221924aa885eb0daf7f2c9;hp=2dfeebe26546491300356912358dd242a7b598bf;p=dpdk.git net/virtio-user: fix crash when detaching device The rte_eth_dev.data pointer is set to a reference to a static table. Attempting to rte_free() it leads to a panic. For example, the following commands result in a panic if run in testpmd testpmd> port attach virtio_user0,path=/dev/vhost-net,iface=test0 testpmd> port stop 2 testpmd> port close 2 testpmd> port detach 2 Fixes: ce2eabdd43ec ("net/virtio-user: add virtual device") Cc: stable@dpdk.org Signed-off-by: Allain Legacy Acked-by: Yuanhan Liu --- diff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c index 280406c028..e9af946e89 100644 --- a/drivers/net/virtio/virtio_user_ethdev.c +++ b/drivers/net/virtio/virtio_user_ethdev.c @@ -556,7 +556,6 @@ virtio_user_pmd_remove(struct rte_vdev_device *vdev) virtio_user_dev_uninit(dev); rte_free(eth_dev->data->dev_private); - rte_free(eth_dev->data); rte_eth_dev_release_port(eth_dev); return 0;