From: Emil Velikov Date: Thu, 3 Oct 2024 16:02:45 +0000 (+0100) Subject: tools/insmod: initialize use_syslog X-Git-Tag: v34~260 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=76db5422f92de96c1583f02d2f7db6b0c271fda6;p=thirdparty%2Fkmod.git tools/insmod: 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: ca8f04e8 ("tools/insmod: add syslog and verbose options") Signed-off-by: Emil Velikov Link: https://github.com/kmod-project/kmod/pull/172 Signed-off-by: Lucas De Marchi --- diff --git a/tools/insmod.c b/tools/insmod.c index 02eea913..60b8c7c3 100644 --- a/tools/insmod.c +++ b/tools/insmod.c @@ -65,7 +65,7 @@ static int do_insmod(int argc, char *argv[]) char *opts = NULL; size_t optslen = 0; int verbose = LOG_ERR; - int use_syslog; + int use_syslog = 0; int i, err = 0, r = 0; const char *null_config = NULL; unsigned int flags = 0;