From patchwork Tue Sep 29 00:58:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 259989 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B92BC2D0A8 for ; Tue, 29 Sep 2020 00:58:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C761721734 for ; Tue, 29 Sep 2020 00:58:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601341125; bh=U/iePW0NAwDYXNrYdGoLVqVliWfgDja1rnHmeuDRvJM=; h=From:To:Cc:Subject:Date:List-ID:From; b=jszUlC2AElC2PztBQnC1SfqrqdAdJXxqWxwll5uNWYJGZpNGvwvycHUshbEKfMzF6 IMpYZrAwLDUF8BrfIqm7HssgItUF6asFSxpMksebfFShgC1HvlSxcpR8oRxY5oQBQl O8cyuxff3KoDpzTnLi6e50B07zf+ZxNBCLZA972w= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727177AbgI2A6p (ORCPT ); Mon, 28 Sep 2020 20:58:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:59602 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727026AbgI2A6o (ORCPT ); Mon, 28 Sep 2020 20:58:44 -0400 Received: from kicinski-fedora-PC1C0HJN.thefacebook.com (unknown [163.114.132.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3E1CE207C4; Tue, 29 Sep 2020 00:58:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601341124; bh=U/iePW0NAwDYXNrYdGoLVqVliWfgDja1rnHmeuDRvJM=; h=From:To:Cc:Subject:Date:From; b=dW+Ob0yH1Zh3MFHQ20o0SV+EH/nMwE2v0gUV49uix4tLSlMhu4Ktee+rIGiUPYh5O kKRWS7Sl9H/iTMbWm9ZcMao2TVP6MvADZvGTnSLXZII9jMkFuHh6EvWNeezV6CiuVX 6bAaR+H/D8//Y+5VESc7EgH8T+F0rBLgcSbclWfc= From: Jakub Kicinski To: davem@davemloft.net Cc: mkubecek@suse.cz, netdev@vger.kernel.org, Jakub Kicinski Subject: [PATCH net v2] ethtool: mark netlink family as __ro_after_init Date: Mon, 28 Sep 2020 17:58:41 -0700 Message-Id: <20200929005841.3640817-1-kuba@kernel.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Like all genl families ethtool_genl_family needs to not be a straight up constant, because it's modified/initialized by genl_register_family(). After init, however, it's only passed to genlmsg_put() & co. therefore we can mark it as __ro_after_init. Since genl_family structure contains function pointers mark this as a fix. Fixes: 2b4a8990b7df ("ethtool: introduce ethtool netlink interface") Signed-off-by: Jakub Kicinski --- net/ethtool/netlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ethtool/netlink.c b/net/ethtool/netlink.c index 5c2072765be7..0c3f54baec4e 100644 --- a/net/ethtool/netlink.c +++ b/net/ethtool/netlink.c @@ -866,7 +866,7 @@ static const struct genl_multicast_group ethtool_nl_mcgrps[] = { [ETHNL_MCGRP_MONITOR] = { .name = ETHTOOL_MCGRP_MONITOR_NAME }, }; -static struct genl_family ethtool_genl_family = { +static struct genl_family ethtool_genl_family __ro_after_init = { .name = ETHTOOL_GENL_NAME, .version = ETHTOOL_GENL_VERSION, .netnsok = true,