From: Josh Law Date: Thu, 12 Mar 2026 21:52:49 +0000 (+0000) Subject: lib/glob: initialize back_str to silence uninitialized variable warning X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c9ba82624b684679b37c5062b697c85f932089b9;p=thirdparty%2Fkernel%2Fstable.git lib/glob: initialize back_str to silence uninitialized variable warning back_str is only used when back_pat is non-NULL, and both are always set together, so it is safe in practice. Initialize back_str to NULL to make this safety invariant explicit and silence compiler/static analysis warnings. Link: https://lkml.kernel.org/r/20260312215249.50165-1-objecting@objecting.org Signed-off-by: Josh Law Reviewed-by: Andrew Morton Signed-off-by: Andrew Morton --- diff --git a/lib/glob.c b/lib/glob.c index 69311568ad3d..7aca76c25bcb 100644 --- a/lib/glob.c +++ b/lib/glob.c @@ -47,7 +47,7 @@ bool __pure glob_match(char const *pat, char const *str) * (no exception for /), it can be easily proved that there's * never a need to backtrack multiple levels. */ - char const *back_pat = NULL, *back_str; + char const *back_pat = NULL, *back_str = NULL; /* * Loop over each token (character or class) in pat, matching