From nobody Fri Apr 10 17:07:08 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1C17C00140 for ; Wed, 24 Aug 2022 11:00:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236724AbiHXLAU convert rfc822-to-8bit (ORCPT ); Wed, 24 Aug 2022 07:00:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236041AbiHXLAS (ORCPT ); Wed, 24 Aug 2022 07:00:18 -0400 Received: from mx1.emlix.com (mx1.emlix.com [136.243.223.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E1EC2ED59 for ; Wed, 24 Aug 2022 04:00:14 -0700 (PDT) Received: from mailer.emlix.com (p5098be52.dip0.t-ipconnect.de [80.152.190.82]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.emlix.com (Postfix) with ESMTPS id E35F85FB51; Wed, 24 Aug 2022 13:00:12 +0200 (CEST) From: Rolf Eike Beer To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Dan Carpenter , Nathan Chancellor Subject: [PATCH 7/6] mm: pagewalk: add back missing variable initializations Date: Wed, 24 Aug 2022 13:00:11 +0200 Message-ID: <2123960.ggj6I0NvhH@mobilepool36.emlix.com> In-Reply-To: <3200642.44csPzL39Z@devpool047> References: <3200642.44csPzL39Z@devpool047> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org These initializations accidentially got lost during refactoring. The first one can't actually be used without initialization, because walk_p4d_range() is only called when one of the 4 callbacks is set, but rel= ying on this seems fragile. Reported-by: Linux Kernel Functional Testing Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Rolf Eike Beer Reviewed-by: Nathan Chancellor --- mm/pagewalk.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) Looks like my testing had just the right callbacks set so I never hit this.= In=20 case you want to have this squashed into the original one just drop me a no= te=20 and I'll redo the whole series. diff --git a/mm/pagewalk.c b/mm/pagewalk.c index d8be8a30b272..22e4bcca9bee 100644 --- a/mm/pagewalk.c +++ b/mm/pagewalk.c @@ -223,7 +223,7 @@ static int walk_p4d_range(pgd_t *pgd, unsigned long add= r, unsigned long end, =20 p4d =3D p4d_offset(pgd, addr); do { - int err; + int err =3D 0; =20 next =3D p4d_addr_end(addr, end); if (p4d_none_or_clear_bad(p4d)) { @@ -262,7 +262,7 @@ static int walk_pgd_range(unsigned long addr, unsigned = long end, else pgd =3D pgd_offset(walk->mm, addr); do { - int err; + int err =3D 0; =20 next =3D pgd_addr_end(addr, end); if (pgd_none_or_clear_bad(pgd)) { @@ -308,7 +308,7 @@ static int walk_hugetlb_range(unsigned long addr, unsig= ned long end, const struct mm_walk_ops *ops =3D walk->ops; =20 for (; addr < end; addr =3D next) { - int err; + int err =3D 0; pte_t *pte =3D huge_pte_offset(walk->mm, addr & hmask, sz); =20 next =3D hugetlb_entry_end(h, addr, end); --=20 2.37.2 --=20 Rolf Eike Beer, emlix GmbH, https://www.emlix.com Fon +49 551 30664-0, Fax +49 551 30664-11 Gothaer Platz 3, 37083 G=C3=B6ttingen, Germany Sitz der Gesellschaft: G=C3=B6ttingen, Amtsgericht G=C3=B6ttingen HR B 3160 Gesch=C3=A4ftsf=C3=BChrung: Heike Jordan, Dr. Uwe Kracke =E2=80=93 Ust-IdNr= .: DE 205 198 055 emlix - smart embedded open source