Skip to content

Commit 7737e46

Browse files
Joelgranadosmcgrof
authored andcommitted
ax.25: 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. We hold off the SIZE_MAX to ARRAY_SIZE change until we have migrated all the relevant net sysctl registering functions to register_net_sysctl_sz in subsequent commits. Signed-off-by: Joel Granados <[email protected]> Signed-off-by: Luis Chamberlain <[email protected]>
1 parent 95d4977 commit 7737e46

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/ax25/sysctl_net_ax25.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,8 @@ int ax25_register_dev_sysctl(ax25_dev *ax25_dev)
159159
table[k].data = &ax25_dev->values[k];
160160

161161
snprintf(path, sizeof(path), "net/ax25/%s", ax25_dev->dev->name);
162-
ax25_dev->sysheader = register_net_sysctl(&init_net, path, table);
162+
ax25_dev->sysheader = register_net_sysctl_sz(&init_net, path, table,
163+
ARRAY_SIZE(ax25_param_table));
163164
if (!ax25_dev->sysheader) {
164165
kfree(table);
165166
return -ENOMEM;

0 commit comments

Comments
 (0)