summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWojciech Dec <wdec@cisco.com>2017-01-18 17:37:15 +0100
committerJohn Lo <loj@cisco.com>2017-01-18 17:40:55 +0000
commit1b3d4ded5f347916132a5a39664867bded834b78 (patch)
treecdd958472051357dead621866f8e6ea86dec6173
parentcd8a22ae1f15ffef6cdfbdd3d26b5cfb65b10d95 (diff)
Fix crash on deleting activated vhost-user - VPP-603
Vhost-user pool getting freed prematurely Change-Id: I90b70889d2e5a01203dc7679583b7c9eff65a374 Signed-off-by: Wojciech Dec <wdec@cisco.com>
-rw-r--r--vnet/vnet/devices/virtio/vhost-user.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/vnet/vnet/devices/virtio/vhost-user.c b/vnet/vnet/devices/virtio/vhost-user.c
index fa64f102311..88f9ddecdbc 100644
--- a/vnet/vnet/devices/virtio/vhost-user.c
+++ b/vnet/vnet/devices/virtio/vhost-user.c
@@ -2422,9 +2422,6 @@ vhost_user_delete_if (vnet_main_t * vnm, vlib_main_t * vm, u32 sw_if_index)
// Disable and reset interface
vhost_user_term_if (vui);
- // Back to pool
- pool_put (vum->vhost_user_interfaces, vui);
-
// Reset renumbered iface
if (hwif->dev_instance <
vec_len (vum->show_dev_instance_by_real_dev_instance))
@@ -2432,6 +2429,9 @@ vhost_user_delete_if (vnet_main_t * vnm, vlib_main_t * vm, u32 sw_if_index)
// Delete ethernet interface
ethernet_delete_interface (vnm, vui->hw_if_index);
+
+ // Back to pool
+ pool_put (vum->vhost_user_interfaces, vui);
return rv;
}