From: Tom Rix <trix@redhat.com>
To: nathan@kernel.org, ndesaulniers@google.com
Cc: linux-kernel@vger.kernel.org, llvm@lists.linux.dev,
Tom Rix <trix@redhat.com>
Subject: [PATCH] lib: remove back_str initialization
Date: Sat, 2 Apr 2022 09:15:46 -0400 [thread overview]
Message-ID: <20220402131546.3383578-1-trix@redhat.com> (raw)
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.
Signed-off-by: Tom Rix <trix@redhat.com>
---
lib/glob.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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
--
2.27.0
next reply other threads:[~2022-04-02 13:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-02 13:15 Tom Rix [this message]
2022-04-05 18:05 ` Nick Desaulniers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220402131546.3383578-1-trix@redhat.com \
--to=trix@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®