summaryrefslogtreecommitdiffstats
path: root/src/vnet/devices
diff options
context:
space:
mode:
authorWojciech Dec <wdec@cisco.com>2017-01-17 21:45:11 +0100
committerFlorin Coras <florin.coras@gmail.com>2017-01-17 22:21:04 +0000
commitd8e478762919b5d40529d72edd3ff8a85fbe9800 (patch)
tree365b5f4da4b72becd24105cca6a4a47da889ede5 /src/vnet/devices
parent7a161da36eeedcf3b2e932e66fa18b34d8cdda2b (diff)
Fix crash on deleting activated vhost-user - VPP-603
Vhost-user pool getting freed prematurely Change-Id: I952821ec85efa68923d09a643c70b6b309ea2574 Signed-off-by: Wojciech Dec <wdec@cisco.com>
Diffstat (limited to 'src/vnet/devices')
-rw-r--r--src/vnet/devices/virtio/vhost-user.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/vnet/devices/virtio/vhost-user.c b/src/vnet/devices/virtio/vhost-user.c
index ee41ee1858b..9a7c1dc0832 100644
--- a/src/vnet/devices/virtio/vhost-user.c
+++ b/src/vnet/devices/virtio/vhost-user.c
@@ -2429,9 +2429,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))
@@ -2439,6 +2436,10 @@ 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;
}