summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Grajciar <jgrajcia@cisco.com>2018-06-11 12:22:46 +0200
committerDamjan Marion <dmarion@me.com>2018-06-12 19:06:41 +0000
commit02ff5f7ce08a13477ffaae5c413a0de6aac68afd (patch)
tree4d1cfcac9c8d6dc784f1b304f2b2b46dd72c0d45
parent00dfe54eec347bea779c861b0a1de59ab7680aa8 (diff)
avf: fix crash if device is busy
Change-Id: I170d78c8e5f7e16a264c9f226a09693109aece5e Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
-rw-r--r--src/plugins/avf/device.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/plugins/avf/device.c b/src/plugins/avf/device.c
index c73cf1e1e68..a08a952dd04 100644
--- a/src/plugins/avf/device.c
+++ b/src/plugins/avf/device.c
@@ -1075,7 +1075,14 @@ avf_create_if (vlib_main_t * vm, avf_create_if_args_t * args)
ad->flags |= AVF_DEVICE_F_ELOG;
if ((error = vlib_pci_device_open (&args->addr, avf_pci_device_ids, &h)))
- goto error;
+ {
+ pool_put (am->devices, ad);
+ args->rv = VNET_API_ERROR_INVALID_INTERFACE;
+ args->error =
+ clib_error_return (error, "pci-addr %U", format_vlib_pci_addr,
+ &args->addr);
+ return;
+ }
ad->pci_dev_handle = h;
vlib_pci_set_private_data (h, ad->dev_instance);