rdma: fix crash when failing to detect numa node on create 13/22713/2
authorBenoît Ganne <bganne@cisco.com>
Mon, 7 Oct 2019 13:57:32 +0000 (15:57 +0200)
committerAndrew Yourtchenko <ayourtch@gmail.com>
Tue, 15 Oct 2019 10:45:50 +0000 (10:45 +0000)
Type: fix

Change-Id: Ibb8e7c1c13869c1dce2385f58bd7260fcf776c5a
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 90ea5dc1bd7adcedd0d5765c3ee04c98c4853337)

src/plugins/rdma/device.c

index 32b7ea5..ea6d278 100644 (file)
@@ -635,6 +635,11 @@ rdma_create_if (vlib_main_t * vm, rdma_create_if_args_t * args)
   rd->pci = vlib_pci_get_device_info (vm, &pci_addr, &args->error);
   if (!rd->pci)
     goto err2;
+
+  /* if we failed to parse NUMA node, default to 0 */
+  if (-1 == rd->pci->numa_node)
+    rd->pci->numa_node = 0;
+
   rd->pool = vlib_buffer_pool_get_default_for_numa (vm, rd->pci->numa_node);
 
   if (strncmp ((char *) rd->pci->driver_name, "mlx5_core", 9))