From 6186b909d76a10bc836cbbd37342283e80d86cb7 Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Thu, 3 Oct 2024 17:02:45 +0100 Subject: [PATCH] tools/lsmod: initialize use_syslog Initialize the variable, otherwise we'll get (random) stack value if the user hasn't provided --syslog. Reported by scan-build. Fixes: 6313d40d ("tools/lsmod: add basic opts like rmmod") Signed-off-by: Emil Velikov Link: https://github.com/kmod-project/kmod/pull/172 Signed-off-by: Lucas De Marchi --- tools/lsmod.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/lsmod.c b/tools/lsmod.c index 3d5a54a5..b344e58c 100644 --- a/tools/lsmod.c +++ b/tools/lsmod.c @@ -44,7 +44,7 @@ static int do_lsmod(int argc, char *argv[]) const char *null_config = NULL; struct kmod_list *list, *itr; int verbose = LOG_ERR; - int use_syslog; + int use_syslog = 0; int err, r = 0; for (;;) { -- 2.47.3