aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/avf/format.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2020-09-09 17:40:02 +0200
committerAndrew Yourtchenko <ayourtch@gmail.com>2020-09-16 12:45:16 +0000
commit4b952f85bd24c8dfe72d3173f6bfbb27f67c2e2c (patch)
tree9642f4c9e56fba6848a71704952e007a06be2597 /src/plugins/avf/format.c
parent00f21fb2fed0b6cf10eda45913b98a20e7b4cd3f (diff)
avf: fix race between avf and cli/api process
device pool my grow during suspemd which will cause crash in avf process after it exits from suspend. Type: fix Change-Id: I51fec90088c909cfbaaca6c245272a28c0827ca0 Signed-off-by: Damjan Marion <damarion@cisco.com> (cherry picked from commit 171d6aceb039a7f0b0d67c837ff74359dae01ae4)
Diffstat (limited to 'src/plugins/avf/format.c')
-rw-r--r--src/plugins/avf/format.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/plugins/avf/format.c b/src/plugins/avf/format.c
index bc2b94ecc46..e5da0e2bbf6 100644
--- a/src/plugins/avf/format.c
+++ b/src/plugins/avf/format.c
@@ -27,8 +27,7 @@ format_avf_device_name (u8 * s, va_list * args)
{
vlib_main_t *vm = vlib_get_main ();
u32 i = va_arg (*args, u32);
- avf_main_t *am = &avf_main;
- avf_device_t *ad = vec_elt_at_index (am->devices, i);
+ avf_device_t *ad = avf_get_device (i);
vlib_pci_addr_t *addr = vlib_pci_get_addr (vm, ad->pci_dev_handle);
if (ad->name)
@@ -88,8 +87,7 @@ u8 *
format_avf_device (u8 * s, va_list * args)
{
u32 i = va_arg (*args, u32);
- avf_main_t *am = &avf_main;
- avf_device_t *ad = vec_elt_at_index (am->devices, i);
+ avf_device_t *ad = avf_get_device (i);
u32 indent = format_get_indent (s);
u8 *a = 0;