From: "Michael C. Pratt" <mcpratt@pm.me>
To: linux-mips@vger.kernel.org
Cc: "Michael C. Pratt" <mcpratt@pm.me>,
linux-kernel@vger.kernel.org,
Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: [PATCH] mips: vdso: fix uninitialized warning for genvdso
Date: Wed, 11 Nov 2026 02:46:05 +0000 [thread overview]
Message-ID: <20261111024520.17905-1-mcpratt@pm.me> (raw)
On older versions of GCC such as GCC 10.2.1,
it is possible that a "maybe-uninitialized" warning is triggered
for the pointer variables in the header's inline functions
when all warnings are enabled.
Resolve this warning by initializing all the pointers to NULL.
Signed-off-by: Michael C. Pratt <mcpratt@pm.me>
---
arch/mips/vdso/genvdso.h | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/arch/mips/vdso/genvdso.h b/arch/mips/vdso/genvdso.h
index 9bfb874038b0..112f51e2e546 100644
--- a/arch/mips/vdso/genvdso.h
+++ b/arch/mips/vdso/genvdso.h
@@ -7,9 +7,9 @@
static inline bool FUNC(patch_vdso)(const char *path, void *vdso)
{
const ELF(Ehdr) *ehdr = vdso;
- void *shdrs;
- ELF(Shdr) *shdr;
- char *shstrtab, *name;
+ void *shdrs = NULL;
+ ELF(Shdr) *shdr = NULL;
+ char *shstrtab = NULL, *name = NULL;
uint16_t sh_count, sh_entsize, i;
shdrs = vdso + FUNC(swap_uint)(ehdr->e_shoff);
@@ -58,10 +58,10 @@ static inline bool FUNC(patch_vdso)(const char *path, void *vdso)
static inline bool FUNC(get_symbols)(const char *path, void *vdso)
{
const ELF(Ehdr) *ehdr = vdso;
- void *shdrs, *symtab;
- ELF(Shdr) *shdr;
- const ELF(Sym) *sym;
- char *strtab, *name;
+ void *shdrs = NULL, *symtab = NULL;
+ ELF(Shdr) *shdr = NULL;
+ const ELF(Sym) *sym = NULL;
+ char *strtab = NULL, *name = NULL;
uint16_t sh_count, sh_entsize, st_count, st_entsize, i, j;
uint64_t offset;
uint32_t flags;
--
2.30.2
reply other threads:[~2026-11-11 2:46 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261111024520.17905-1-mcpratt@pm.me \
--to=mcpratt@pm.me \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=tsbogend@alpha.franken.de \
/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®