From 07a62cc236978a0f01ec8be70bdd1d3e8fa27f71 Mon Sep 17 00:00:00 2001 From: Damjan Marion Date: Thu, 16 Nov 2023 19:14:12 +0000 Subject: dev: fix null dereference of arg list Type: fix Fixes: 69768d9 Change-Id: Iafd3a55634583f2799a81c477ccbf5e53b6f29d0 Signed-off-by: Damjan Marion --- src/vnet/dev/api.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/vnet/dev/api.c') 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) { -- cgit 1.2.3-korg