From: Emil Velikov Date: Thu, 3 Oct 2024 16:02:45 +0000 (+0100) Subject: tools/rmmod: initialize use_syslog X-Git-Tag: v34~259 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c566ae7a34aeabb1e36ec9510eee2cd8cea54d1e;p=thirdparty%2Fkmod.git tools/rmmod: 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: 24fe68dc ("tools/rmmod: make opt variables non-global") Signed-off-by: Emil Velikov Link: https://github.com/kmod-project/kmod/pull/172 Signed-off-by: Lucas De Marchi --- diff --git a/tools/rmmod.c b/tools/rmmod.c index 83169787..ed985a8c 100644 --- a/tools/rmmod.c +++ b/tools/rmmod.c @@ -94,7 +94,7 @@ static int do_rmmod(int argc, char *argv[]) struct kmod_ctx *ctx; const char *null_config = NULL; int verbose = LOG_ERR; - int use_syslog; + int use_syslog = 0; int flags = 0; int i, err, r = 0;