From mboxrd@z Thu Jan 1 00:00:00 1970 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 F1BB6C00140 for ; Wed, 24 Aug 2022 15:08:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232675AbiHXPIO (ORCPT ); Wed, 24 Aug 2022 11:08:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237858AbiHXPIM (ORCPT ); Wed, 24 Aug 2022 11:08:12 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FD2598A5D for ; Wed, 24 Aug 2022 08:08:10 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2BD1E618CD for ; Wed, 24 Aug 2022 15:08:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 434F1C433C1; Wed, 24 Aug 2022 15:08:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1661353689; bh=tU6B0BG1UHnHAoMKPgWcGVLqH2nUONmFmE9trFqxNww=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YJfG3FMjAIJtjpl2xQ1ePVd6EGaCkFYP3ExWdnUVdxapmWC9Nng4gpke02wcyH/Jr jFsmBl9mxtCIRqm1fbEHmcaOMpKFqnYbBMRrVDYwVB2VxqC2AQz8ieCuB3cGTcIRs6 RcEnbELd0YeoA60p3L5vS2pGnzc24XyfZvhtf0yeDdNKXfDcu32oH86hLViswEhklM YFpXKPnO2JsvakVE64lHCuSBVkLgXw6W3zqqhL2Jllhw6rdd9k4uQYwnKk7KJWtCmZ 1VVyUmhBGyBwfRN7F/cIIO6dK7flOGje2dF/TngLPm5GSBkfiohmZ5W+bh1RV8iT0a 6Q/gN+eFyXyFQ== Date: Wed, 24 Aug 2022 08:08:07 -0700 From: Nathan Chancellor To: Rolf Eike Beer Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Dan Carpenter Subject: Re: [PATCH 7/6] mm: pagewalk: add back missing variable initializations Message-ID: References: <3200642.44csPzL39Z@devpool047> <2123960.ggj6I0NvhH@mobilepool36.emlix.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2123960.ggj6I0NvhH@mobilepool36.emlix.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 24, 2022 at 01:00:11PM +0200, Rolf Eike Beer wrote: > 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 relying > 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 > case you want to have this squashed into the original one just drop me a note > 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 addr, unsigned long end, > > p4d = p4d_offset(pgd, addr); > do { > - int err; > + int err = 0; > > next = 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 = pgd_offset(walk->mm, addr); > do { > - int err; > + int err = 0; > > next = pgd_addr_end(addr, end); > if (pgd_none_or_clear_bad(pgd)) { > @@ -308,7 +308,7 @@ static int walk_hugetlb_range(unsigned long addr, unsigned long end, > const struct mm_walk_ops *ops = walk->ops; > > for (; addr < end; addr = next) { > - int err; > + int err = 0; > pte_t *pte = huge_pte_offset(walk->mm, addr & hmask, sz); > > next = hugetlb_entry_end(h, addr, end); > -- > 2.37.2 > > -- > Rolf Eike Beer, emlix GmbH, https://www.emlix.com > Fon +49 551 30664-0, Fax +49 551 30664-11 > Gothaer Platz 3, 37083 Göttingen, Germany > Sitz der Gesellschaft: Göttingen, Amtsgericht Göttingen HR B 3160 > Geschäftsführung: Heike Jordan, Dr. Uwe Kracke – Ust-IdNr.: DE 205 198 055 > > emlix - smart embedded open source > >