aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/vnet/dev/api.c7
-rw-r--r--src/vnet/dev/port.c5
2 files changed, 7 insertions, 5 deletions
diff --git a/src/vnet/dev/api.c b/src/vnet/dev/api.c
index 260bc7b2e22..72811f5dee2 100644
--- a/src/vnet/dev/api.c
+++ b/src/vnet/dev/api.c
@@ -90,9 +90,10 @@ vnet_dev_api_attach (vlib_main_t *vm, vnet_dev_api_attach_args_t *args)
}
dev->description = dev_desc;
- for (vnet_dev_arg_t *a = driver->registration->args;
- a->type != VNET_DEV_ARG_END; a++)
- vec_add1 (dev->args, *a);
+ if (driver->registration->args)
+ for (vnet_dev_arg_t *a = driver->registration->args;
+ a->type != VNET_DEV_ARG_END; a++)
+ vec_add1 (dev->args, *a);
if (args->args)
{
diff --git a/src/vnet/dev/port.c b/src/vnet/dev/port.c
index b3f40354c7a..0363ea41b48 100644
--- a/src/vnet/dev/port.c
+++ b/src/vnet/dev/port.c
@@ -267,8 +267,9 @@ vnet_dev_port_add (vlib_main_t *vm, vnet_dev_t *dev, vnet_dev_port_id_t id,
port->rx_node = *args->rx_node;
port->tx_node = *args->tx_node;
- for (vnet_dev_arg_t *a = args->port.args; a->type != VNET_DEV_ARG_END; a++)
- vec_add1 (port->args, *a);
+ if (args->port.args)
+ for (vnet_dev_arg_t *a = args->port.args; a->type != VNET_DEV_ARG_END; a++)
+ vec_add1 (port->args, *a);
/* defaults out of port attributes */
port->max_rx_frame_size = args->port.attr.max_supported_rx_frame_size;