From cfcff4c6f9dbbcfb9bb5cfe1a2bacd42d0519e0d Mon Sep 17 00:00:00 2001 From: Alexey Gladkov Date: Wed, 14 Aug 2024 12:49:29 +0200 Subject: [PATCH] depinfo: Fix build warning Signed-off-by: Alexey Gladkov --- utils/depinfo/kmod-depinfo.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/utils/depinfo/kmod-depinfo.c b/utils/depinfo/kmod-depinfo.c index 98843d57..0c9dfc77 100644 --- a/utils/depinfo/kmod-depinfo.c +++ b/utils/depinfo/kmod-depinfo.c @@ -88,7 +88,7 @@ is_kernel_builtin_match(const char *str) static int append_kernel_builtin(char *name) { - struct kernel_builtin *new, *next, *last; + struct kernel_builtin *new, *next, *last = NULL; if (kbuiltin) { last = next = kbuiltin; @@ -115,7 +115,8 @@ append_kernel_builtin(char *name) return 0; } - last->next = new; + if (last) + last->next = new; return 0; }