Re: [PATCH 3/8] sysctl: Remove check for sentinel element in ctl_table arrays

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jun 04, 2024 at 08:29:21AM +0200, Joel Granados via B4 Relay wrote:
> From: Joel Granados <j.granados@xxxxxxxxxxx>
> --- a/net/sysctl_net.c
> +++ b/net/sysctl_net.c
> @@ -127,7 +127,7 @@ static void ensure_safe_net_sysctl(struct net *net, const char *path,
>  
>  	pr_debug("Registering net sysctl (net %p): %s\n", net, path);
>  	ent = table;
> -	for (size_t i = 0; i < table_size && ent->procname; ent++, i++) {
> +	for (size_t i = 0; i < table_size; ent++, i++) {
>  		unsigned long addr;
>  		const char *where;
>  
> @@ -165,17 +165,10 @@ struct ctl_table_header *register_net_sysctl_sz(struct net *net,
>  						struct ctl_table *table,
>  						size_t table_size)
>  {
> -	int count;
> -	struct ctl_table *entry;
> -
>  	if (!net_eq(net, &init_net))
>  		ensure_safe_net_sysctl(net, path, table, table_size);
>  
> -	entry = table;
> -	for (count = 0 ; count < table_size && entry->procname; entry++, count++)
> -		;
> -
> -	return __register_sysctl_table(&net->sysctls, path, table, count);
> +	return __register_sysctl_table(&net->sysctls, path, table, table_size);
>  }
>  EXPORT_SYMBOL_GPL(register_net_sysctl_sz);
>  

Given that this is a very small network related patch, I'm queueing this
in through the sysctl-next branch. Please let me know if you would
rather take it through the networking workflow.

Best

-- 

Joel Granados




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux