diff options
author | Damjan Marion <damarion@cisco.com> | 2023-11-16 19:14:12 +0000 |
---|---|---|
committer | Ole Tr�an <otroan@employees.org> | 2023-11-24 13:25:26 +0000 |
commit | 07a62cc236978a0f01ec8be70bdd1d3e8fa27f71 (patch) | |
tree | 4b1b01b42a0deaa75faa83dd4c2fb9bbd2bffddc /src/vnet/dev/port.c | |
parent | 20e37d2639d54f7bf6ec28e80f3da1f7316f16a2 (diff) |
dev: fix null dereference of arg list
Type: fix
Fixes: 69768d9
Change-Id: Iafd3a55634583f2799a81c477ccbf5e53b6f29d0
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vnet/dev/port.c')
-rw-r--r-- | src/vnet/dev/port.c | 5 |
1 files changed, 3 insertions, 2 deletions
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; |