From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=193.175.24.41 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796469554; b=F5tINxzAbEejIaMz2kVUZ2z65AsBA9RQvSazk4SjgCtFsMoTveQZqwJ7iB/Vqg21dU7M sDMRAdHQbWzSJfMxG9UBNL+3J4Z6dXj176OOorgiuoMOeJxYBlsph1xgStE6r33PE/vWk BBUfVGqbp26EAmN/5nxP/HDXyYk80METu3P4nqnVCcf6/Bcr8tXYICaCARgH1xve1LSbE d8dbASPzl1rjDq8+mygVSeybD7o9AH2ulTVn7iuOFL77ZS04+70eoBuZohq51yd7uVbn9 GznbaduKZaFaHZw4+MxtyODgTIc2e1jUtCkufKKr84rvDxxqKxwkVS9MfulySGUusKg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796469554; h=DMARC-Filter:Received:Received:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=fmtV1MkPL/RHAmCF2U3rY5E8F4yjz79Suv+Ld725DAc=; b=5KI+95yxpB1RWCNs3a5s21PM/jGXCE4ZVVi2I2q2QSjQw+uHduFyOYSFWMijyBSQsdMC of4Fk3+n/JcJF1hOMN5FD5GSjvX4foSevB6ac3XWraeUmS2GX2LmoC0IdWvxffU9HCxeT khZh/lWrjNFgGD+lZ0bROdkIHG/o6B4OXgxfyn1YhOqg5lmxIChevvcnbjdjQEApl/aVt de9ycf9GQtIab4cMeNO3ymTtFOJvzTULqG7BRJVf60EUv5fkpxYZJgWl+nZb4OKP18LEe hEfzRpQFOnYN78cJyJC+rt4o9QvVKDSVDuvbZ6zlEN2OJk6mU+OzxV5Fdyv65ot+wfQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=alpha.franken.de; spf=pass smtp.mailfrom=alpha.franken.de; arc=none smtp.remote-ip=193.175.24.41 Received: from elvis.franken.de (elvis.franken.de [193.175.24.41]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C19B8606A333; Sat, 5 Dec 2026 11:19:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org C19B8606A333 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=alpha.franken.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alpha.franken.de Received: by elvis.franken.de (Postfix, from userid 10) id B2C98100458; Sat, 5 Dec 2026 12:19:11 +0100 (CET) Received: by alpha.franken.de (Postfix, from userid 1000) id 2F9BBC081A; Sat, 5 Dec 2026 12:08:31 +0100 (CET) Date: Sat, 5 Dec 2026 12:08:31 +0100 From: Thomas Bogendoerfer To: "Michael C. Pratt" Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman Subject: Re: [PATCH] mips: vdso: fix uninitialized warning for genvdso Message-ID: References: <20261111024520.17905-1-mcpratt@pm.me> X-Mailing-List: linux-mips@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261111024520.17905-1-mcpratt@pm.me> On Wed, Nov 11, 2026 at 02:46:05AM +0000, Michael C. Pratt wrote: > 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 > --- > 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); I don't see why the compiler thinks any of them are uninitialized. > @@ -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; following line is shdrs = vdso + FUNC(swap_uint)(ehdr->e_shoff); so shdrs is always initialized. But with sh_count the others might be uninitialized, but then the function exists early. I'm not going to apply this as the code is correct, IMHO. Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]