diff options
author | Tom Rix <trix@redhat.com> | 2022-04-29 14:38:01 -0700 |
---|---|---|
committer | akpm <akpm@linux-foundation.org> | 2022-04-29 14:38:01 -0700 |
commit | d1bd5fa07667fcc3e38996ec42aef98761f23039 (patch) | |
tree | 5d9044942369ee104ae52fdd123bca2665929843 /lib | |
parent | dffad91b06e0a1ee584f008565cbf2bb508a9777 (diff) |
lib: remove back_str initialization
Clang static analysis reports this false positive
glob.c:48:32: warning: Assigned value is garbage
or undefined
char const *back_pat = NULL, *back_str = back_str;
^~~~~~~~ ~~~~~~~~
back_str is set after back_pat and it's use is protected by the !back_pat
check. It is not necessary to initialize back_str, so remove the
initialization.
Link: https://lkml.kernel.org/r/20220402131546.3383578-1-trix@redhat.com
Signed-off-by: Tom Rix <trix@redhat.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Cc: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/glob.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/glob.c b/lib/glob.c index 85ecbda45cd8..15b73f490720 100644 --- a/lib/glob.c +++ b/lib/glob.c @@ -45,7 +45,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 = back_str; + char const *back_pat = NULL, *back_str; /* * Loop over each token (character or class) in pat, matching |