Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1875970rwb; Wed, 26 Jul 2023 21:35:57 -0700 (PDT) X-Google-Smtp-Source: APBJJlEls0qX7/4iq/whKRydichZovPV1dnZOOjzdusAxWdmYCNE4T0v1SIjW3ZvqJrRkhZLYglS X-Received: by 2002:a05:6a00:1827:b0:686:6166:3739 with SMTP id y39-20020a056a00182700b0068661663739mr2040255pfa.13.1690432557116; Wed, 26 Jul 2023 21:35:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690432557; cv=none; d=google.com; s=arc-20160816; b=aPo/UKFpz0tbJGsQOdprbIl21MsXxB8wE0LI8Rh67mXUgyrWyxM8eeQQEpdswiaMzb qdXAYEVs7oGJhA1z5WZhEddp1fdB1tP7jIxr83oQwHQ1nAJq8jxKm/XcmVpJbXh2J4Hy F8btu6+IJHuQRGgFf+btVWvnV7Xs45yK4GaUJepVrO5PU+A+wuGbOnRPMttdTo/Q/59c CzJs7VFx1H+FCI9BEuU1LQuywuOwRRi37B0FSGLxYaJLb2MBV6xyNEw/C0Q0wCVm2voe OMv/oTXaQ6StSAgEHOd3ux+4PCt9kRQifzlR3zyMG62nN0lEIsrYegcq1bhwGaiTYaHr TB+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=+BhfEfTwsVWb4lMGlirgkatU5psP/3dC4qP0gL1ON8o=; fh=nGvHcHcl+SFoNBWwb4At8DGUldA/zrYcRb9poWFp0hM=; b=wIwiBfub2o0WYpbaOX9H+MnMHYVq2soRg1Ie9k0m12AZyPbubdJ9VnN5s2Kj7zSyUn tuqhHRlGxy/EJyo3zJAAzsUek5enjhcAL4jT/Up53rhmc6V6rmrBeJJ4Tw/2v8mps26K dZh4Q+mu4GyqPbhLjFTJ6SsYywbjxYTCD7BfFrlm6wgbkzt1lh6S7vvlaZ6BwwiAvf62 4ERIpYvRtnNepJDicRRS47Gs2ZZEMZSUGRcKnHLC7LttLxLkTN2095ldyzjIiBiHi7Sw thss5VJzisAvY/pxgqnH5tKlG8gezEC/aJl8pEO8kziwAJ4DCotmsAeVt3iT/f04Otdd kKqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZdbvuDap; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v63-20020a638942000000b00563e1d607bcsi490049pgd.411.2023.07.26.21.35.44; Wed, 26 Jul 2023 21:35:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZdbvuDap; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231569AbjG0EDG (ORCPT + 99 others); Thu, 27 Jul 2023 00:03:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230406AbjG0ECw (ORCPT ); Thu, 27 Jul 2023 00:02:52 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 699911BC3; Wed, 26 Jul 2023 21:02:49 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id F194761D1F; Thu, 27 Jul 2023 04:02:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 622B7C433C7; Thu, 27 Jul 2023 04:02:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690430568; bh=xmIo8Za+wGb3kA2DcO9/AhwOvETbc1Ip+6DhLrfwd9I=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=ZdbvuDapJ3/oAxqWo9LZn+q1uZ1c7FPcY6urQKKOCfVI6KfKFIfyz3ZpErbhtr2SX ba35woGOtesd6yopwpxae/soGGWyz3B/kEGPfvRbd9RzmaRPEc2j1Pjb39iXNyGZky 1EdJA2ILs83eyxOZWkov4G0IZZ4XUPqDU5GgF/nViIBEXc2DSic2DzGbSSlLsBE9mk FckXnRJpb3mkVtiPJ4TaajKJQ+tudb2+hwVbsJXP1D8o59sILscf3CEUMFKHk4eUUV SsqIc3f4mJsmgfrUmECxhU80bJk0WZmgXGYBvjJL3XhjXzSbh7qym/CU4kOZfczHZ3 YwruHM8CThrmw== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 09ED8CE0BDA; Wed, 26 Jul 2023 21:02:48 -0700 (PDT) Date: Wed, 26 Jul 2023 21:02:48 -0700 From: "Paul E. McKenney" To: Joel Fernandes Cc: linux-kernel@vger.kernel.org, Lai Jiangshan , Josh Triplett , Steven Rostedt , Mathieu Desnoyers , "open list:SLEEPABLE READ-COPY UPDATE (SRCU)" Subject: Re: [PATCH 2/5] srcu: Fix error handling in init_srcu_struct_fields() Message-ID: <3549e916-3829-40b8-b2ae-7a969826105c@paulmck-laptop> Reply-To: paulmck@kernel.org References: <20230725232913.2981357-1-joel@joelfernandes.org> <20230725232913.2981357-3-joel@joelfernandes.org> <1943e34c-3c8e-411c-a677-33f8c5b4b0e5@paulmck-laptop> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 26, 2023 at 11:04:04PM -0400, Joel Fernandes wrote: > > > On 7/26/23 17:07, Paul E. McKenney wrote: > >> - free_percpu(ssp->sda); > >> - ssp->sda = NULL; > >> - kfree(ssp->srcu_sup); > >> - return -ENOMEM; > >> - } > >> - } else { > >> + if (!init_srcu_struct_nodes(ssp, GFP_ATOMIC)) > >> + goto err_free_sda; > >> + else > >> WRITE_ONCE(ssp->srcu_sup->srcu_size_state, SRCU_SIZE_BIG); > > Given that the "then" clause is a goto, what is the "else" clause doing > > for us? > > > > Not much. Agreed we can get rid of "else" and reduce indent of the > WRITE_ONCE that follows. > > Would you mind making this fixup in the patch for your apply, or would > you like me to refresh the patch? Let me know either way, thank you! Please include it with your next series, which has at least one other change anyway. ;-) Thanx, Paul