Skip to content

Commit 78b7015

Browse files
kuba-moodavem330
authored andcommitted
ethtool: mark netlink family as __ro_after_init
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: 2b4a899 ("ethtool: introduce ethtool netlink interface") Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 3ddf9b4 commit 78b7015

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/ethtool/netlink.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,7 @@ static const struct genl_multicast_group ethtool_nl_mcgrps[] = {
866866
[ETHNL_MCGRP_MONITOR] = { .name = ETHTOOL_MCGRP_MONITOR_NAME },
867867
};
868868

869-
static struct genl_family ethtool_genl_family = {
869+
static struct genl_family ethtool_genl_family __ro_after_init = {
870870
.name = ETHTOOL_GENL_NAME,
871871
.version = ETHTOOL_GENL_VERSION,
872872
.netnsok = true,

0 commit comments

Comments
 (0)