]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
tools/lsmod: initialize use_syslog
authorEmil Velikov <emil.l.velikov@gmail.com>
Thu, 3 Oct 2024 16:02:45 +0000 (17:02 +0100)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Wed, 9 Oct 2024 04:20:31 +0000 (23:20 -0500)
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 <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/172
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
tools/lsmod.c

index 3d5a54a5cbfe1de4ccc6e3ecdaaffc08ec830888..b344e58c2111abf5e95b8716ff9c1d3e73b9b14e 100644 (file)
@@ -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 (;;) {