net/virtio: fix crash when closing twice
authorHuanle Han <hanxueluo@gmail.com>
Mon, 20 Feb 2017 14:04:46 +0000 (22:04 +0800)
committerYuanhan Liu <yuanhan.liu@linux.intel.com>
Fri, 28 Apr 2017 05:01:22 +0000 (07:01 +0200)
commit0e78cfddc0851a0a12da0257758fe011ec507495
tree2086ea69c1e58d84c9003fbaf6e7415c70bb7b6f
parent2c2201fb0745d3d46be324fa86989224ea2f0d83
net/virtio: fix crash when closing twice

This commit fixs segment fault when rte_eth_dev_close() is called on
a virtio dev more than once.  Assigning zero after free to avoids
freed memory to be accessed again.

Fixes: 69c80d4ef89b ("net/virtio: allocate queue at init stage")
Cc: stable@dpdk.org
Signed-off-by: Huanle Han <hanxueluo@gmail.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
drivers/net/virtio/virtio_ethdev.c
lib/librte_ether/rte_ethdev.c