Skip to content

Commit 3ca9aa7

Browse files
Joelgranadosmcgrof
authored andcommitted
vrf: Update to register_net_sysctl_sz
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 <[email protected]> Signed-off-by: Luis Chamberlain <[email protected]>
1 parent c899710 commit 3ca9aa7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/net/vrf.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1979,7 +1979,8 @@ static int vrf_netns_init_sysctl(struct net *net, struct netns_vrf *nn_vrf)
19791979
/* init the extra1 parameter with the reference to current netns */
19801980
table[0].extra1 = net;
19811981

1982-
nn_vrf->ctl_hdr = register_net_sysctl(net, "net/vrf", table);
1982+
nn_vrf->ctl_hdr = register_net_sysctl_sz(net, "net/vrf", table,
1983+
ARRAY_SIZE(vrf_table));
19831984
if (!nn_vrf->ctl_hdr) {
19841985
kfree(table);
19851986
return -ENOMEM;

0 commit comments

Comments
 (0)