From 02ff5f7ce08a13477ffaae5c413a0de6aac68afd Mon Sep 17 00:00:00 2001 From: Jakub Grajciar Date: Mon, 11 Jun 2018 12:22:46 +0200 Subject: avf: fix crash if device is busy Change-Id: I170d78c8e5f7e16a264c9f226a09693109aece5e Signed-off-by: Jakub Grajciar --- src/plugins/avf/device.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/plugins') 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); -- cgit 1.2.3-korg