Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp5555710rwb; Wed, 9 Aug 2023 06:06:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGXla16CQUXw75SXoksAVEsztfqvPx1U424o6aRgEvkjRMeodtWjZpko1XjjtzeFJCu9e6g X-Received: by 2002:a17:906:32c4:b0:994:9ed:300b with SMTP id k4-20020a17090632c400b0099409ed300bmr2055556ejk.16.1691586383201; Wed, 09 Aug 2023 06:06:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691586383; cv=none; d=google.com; s=arc-20160816; b=quF67H8nbvFWcG96EfV138XuJC8QrmWCNLQHRFtg2FUMqT/NgHk2VrNH9K3MEX1i6g +G7oknzONwcySkh9pgEz4v0P+txtwYMkMnhbbF/Lf/yMxmwTUVa+XUxCnB7sjp9wr+x0 K001zpSFW4fq49/RyJOcZX+8Mp1htlcZboGqTjfM9rckaLYjNJnQ9SABQScVOYuAAYna WV6JIDBu+iMb8SbK3Bz7Dq3z4K7fnrVL5nuMbtTMi3kmYbT+3cg4mIhBVkXlLSxNijiW uDsk0EriZkFsInFME0TDTpzjyPQWUh1/oOQwK+xpuTdlZKN44HRNrRSMrBdv2FrundID Jf1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5coRDrjBWUoHZlIcsYrUKshhaoM+GPSlsGMwisO1OVE=; fh=vrJVathPeHoK961IEaGeDqkbez4IR8NxkZspkqdeRJ4=; b=QF3KtpXf0/2WigSmMpx2mPQWexj6xIVG150YAYyDkpRI+zaXmjVO3Wv57Q8kqLJ/hb f6Nu3o+EjZprLG4NPYZyJqazTVvqGKjHtA95QsJM0J/TPDdvfjQ2DSLr2SL4jPMjDVGq b6hKi9ajCGMI66O7R8qVPkwd6ZQ2LgoOUQvXhw4D8SBeT61eNpMoahlhOQ4LdSZJsrCI hnAboPsYZy0XOEgG+q5TJpEWoyXCkSXjmeg8n2VPipCA4aSabxdBDfm4uYh6ygcRTBSG GJ65Gn41VZQj2WGQD/XQ43eMXfQ4bP06uROnAUmNTocg/XYkZI4BipzYgf8kL/3fEZbM Cjdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=rOcCjLBI; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ko7-20020a170907986700b00992bbbb019dsi9117269ejc.119.2023.08.09.06.05.57; Wed, 09 Aug 2023 06:06:23 -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=@gmail.com header.s=20221208 header.b=rOcCjLBI; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232644AbjHIKvb (ORCPT + 99 others); Wed, 9 Aug 2023 06:51:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232429AbjHIKug (ORCPT ); Wed, 9 Aug 2023 06:50:36 -0400 Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7491D211B; Wed, 9 Aug 2023 03:50:35 -0700 (PDT) Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2b9b904bb04so106974961fa.1; Wed, 09 Aug 2023 03:50:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691578233; x=1692183033; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5coRDrjBWUoHZlIcsYrUKshhaoM+GPSlsGMwisO1OVE=; b=rOcCjLBIeZiN/uKCqBn+ZnIy9GGjjsq5pNXvUnFAqmrNtJ4AytMROihb81KAsXmJ32 Y7Yp5fm6fmP2fGjhIdvMngbMnPvBFVwYNsoQDzVYr9FtuJ64uVVnxbwI3PtEVxiTSLPO UZASCKd04coZGK/tilWlVhuwtgTUeqXcU5Bf1fIwNtI0/y8hj9Yc45yBrsHKfUpCcHDp kFJcIQAdfWb5ym4bbpJbP/lR3gwY0aaag9FOaZ3QviV/VCgx4QfmDZ1aluNctgg7Te0p lG6isVbiPFi0/xEfOVe2L4NzccRRq/tSsjLfJrDm7hubbYzVeX52y/inZs+Y2Yo9JzK3 a3dA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691578233; x=1692183033; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5coRDrjBWUoHZlIcsYrUKshhaoM+GPSlsGMwisO1OVE=; b=O6jX5WhxJRDYCqbQBdLc1WD1DDjOYPwWRV7dgVII+aFKTgkBwQYML444ZHVwxjkkvc ecW5yhaTrO+gRPq89fYZtOAOYt1qzKVO0qW1Ds2nwib9V1eT80TDPPnK9Hatc9Ox9V2a uoRoYaZUcBaeCk7ZLnx6YuusW+j6Zb9APlUJ7GeNQGXK7XqBukNZmQ9S31evrEQlPTKh a/9i10cx6qge92+bXRC4aA072n+uhstdXPJL7PrmlHe5f4rpFEvkPdYWoUGT+uLtmrdZ 0PoCrujcjuT7Z6AutkwQgbvlqXwOW1gBi+/jSp/zsCu7XcIf75VFa/zcv1QYE/rftYHo oHGQ== X-Gm-Message-State: AOJu0Yz6oFqbuStstgwcQsdnOED5KiZGC2i7Qw0aMnUw2LlIMN1dPrDM DdqdWiFPZTJ0nQE2mjmXwbc= X-Received: by 2002:a2e:2e04:0:b0:2b9:ac48:d7fe with SMTP id u4-20020a2e2e04000000b002b9ac48d7femr1633844lju.38.1691578233520; Wed, 09 Aug 2023 03:50:33 -0700 (PDT) Received: from localhost ([165.225.194.193]) by smtp.gmail.com with ESMTPSA id 17-20020a05600c231100b003fc01495383sm1647099wmo.6.2023.08.09.03.50.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Aug 2023 03:50:33 -0700 (PDT) From: Joel Granados X-Google-Original-From: Joel Granados To: mcgrof@kernel.org Cc: rds-devel@oss.oracle.com, "David S. Miller" , Florian Westphal , willy@infradead.org, Jan Karcher , Wen Gu , Simon Horman , Tony Lu , linux-wpan@vger.kernel.org, Matthieu Baerts , Christian Borntraeger , mptcp@lists.linux.dev, Heiko Carstens , Stefan Schmidt , Will Deacon , Julian Anastasov , netfilter-devel@vger.kernel.org, Joerg Reuter , linux-kernel@vger.kernel.org, Alexander Gordeev , linux-sctp@vger.kernel.org, Xin Long , Herbert Xu , linux-hams@vger.kernel.org, Vasily Gorbik , coreteam@netfilter.org, Ralf Baechle , Steffen Klassert , Pablo Neira Ayuso , keescook@chromium.org, Roopa Prabhu , David Ahern , linux-arm-kernel@lists.infradead.org, Catalin Marinas , Jozsef Kadlecsik , Wenjia Zhang , josh@joshtriplett.org, linux-fsdevel@vger.kernel.org, Alexander Aring , Nikolay Aleksandrov , netdev@vger.kernel.org, Santosh Shilimkar , linux-s390@vger.kernel.org, Sven Schnelle , "D. Wythe" , Eric Dumazet , lvs-devel@vger.kernel.org, linux-rdma@vger.kernel.org, Paolo Abeni , Iurii Zaikin , Marcelo Ricardo Leitner , bridge@lists.linux-foundation.org, Karsten Graul , Mat Martineau , Miquel Raynal , Jakub Kicinski , Joel Granados Subject: [PATCH v3 12/14] vrf: Update to register_net_sysctl_sz Date: Wed, 9 Aug 2023 12:50:04 +0200 Message-Id: <20230809105006.1198165-13-j.granados@samsung.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230809105006.1198165-1-j.granados@samsung.com> References: <20230809105006.1198165-1-j.granados@samsung.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS 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 Move from register_net_sysctl to register_net_sysctl_sz and pass the ARRAY_SIZE of the ctl_table array that was used to create the table variable. We need to move to the new function in preparation for when we change SIZE_MAX to ARRAY_SIZE() in the register_net_sysctl macro. Failing to do so would erroneously allow ARRAY_SIZE() to be called on a pointer. The actual change from SIZE_MAX to ARRAY_SIZE will take place in subsequent commits. Signed-off-by: Joel Granados --- drivers/net/vrf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c index 6043e63b42f9..6801f15ac609 100644 --- a/drivers/net/vrf.c +++ b/drivers/net/vrf.c @@ -1979,7 +1979,8 @@ static int vrf_netns_init_sysctl(struct net *net, struct netns_vrf *nn_vrf) /* init the extra1 parameter with the reference to current netns */ table[0].extra1 = net; - nn_vrf->ctl_hdr = register_net_sysctl(net, "net/vrf", table); + nn_vrf->ctl_hdr = register_net_sysctl_sz(net, "net/vrf", table, + ARRAY_SIZE(vrf_table)); if (!nn_vrf->ctl_hdr) { kfree(table); return -ENOMEM; -- 2.30.2