Skip to content

Commit cfcff4c

Browse files
committed
depinfo: Fix build warning
Signed-off-by: Alexey Gladkov <[email protected]>
1 parent a62c12b commit cfcff4c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

utils/depinfo/kmod-depinfo.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ is_kernel_builtin_match(const char *str)
8888
static int
8989
append_kernel_builtin(char *name)
9090
{
91-
struct kernel_builtin *new, *next, *last;
91+
struct kernel_builtin *new, *next, *last = NULL;
9292

9393
if (kbuiltin) {
9494
last = next = kbuiltin;
@@ -115,7 +115,8 @@ append_kernel_builtin(char *name)
115115
return 0;
116116
}
117117

118-
last->next = new;
118+
if (last)
119+
last->next = new;
119120
return 0;
120121
}
121122

0 commit comments

Comments
 (0)