Skip to content

Commit

Permalink
tools/lsmod: initialize use_syslog
Browse files Browse the repository at this point in the history
Initialize the variable, otherwise we'll get (random) stack value if the
user hasn't provided --syslog. Reported by scan-build.

Fixes: 6313d40 ("tools/lsmod: add basic opts like rmmod")
Signed-off-by: Emil Velikov <[email protected]>
Link: #172
Signed-off-by: Lucas De Marchi <[email protected]>
  • Loading branch information
evelikov authored and lucasdemarchi committed Oct 9, 2024
1 parent c566ae7 commit 6186b90
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/lsmod.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 (;;) {
Expand Down

0 comments on commit 6186b90

Please sign in to comment.