net/virtio-user: fix crash when detaching device
authorAllain Legacy <allain.legacy@windriver.com>
Fri, 23 Jun 2017 12:41:37 +0000 (08:41 -0400)
committerYuanhan Liu <yliu@fridaylinux.org>
Tue, 4 Jul 2017 09:31:01 +0000 (11:31 +0200)
commit2a7b7d837ff70b6a58221924aa885eb0daf7f2c9
treefdc86d530809310a06ea16ee2deca2981c02b688
parent2dfeebe26546491300356912358dd242a7b598bf
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 <allain.legacy@windriver.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
drivers/net/virtio/virtio_user_ethdev.c