lkml.org 
[lkml]   [2024]   [Apr]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v5 5/8] net: Remove ctl_table sentinel elements from several networking subsystems
On Fri, Apr 26, 2024 at 05:13:37PM +0200, Sabrina Dubroca wrote:
> 2024-04-26, 12:46:57 +0200, Joel Granados via B4 Relay wrote:
> > diff --git a/net/smc/smc_sysctl.c b/net/smc/smc_sysctl.c
> > index a5946d1b9d60..bd0b7e2f8824 100644
> > --- a/net/smc/smc_sysctl.c
> > +++ b/net/smc/smc_sysctl.c
> > @@ -90,7 +90,6 @@ static struct ctl_table smc_table[] = {
> > .extra1 = &conns_per_lgr_min,
> > .extra2 = &conns_per_lgr_max,
> > },
> > - { }
> > };
>
> There's an ARRAY_SIZE(smc_table) - 1 in smc_sysctl_net_init, shouldn't
> the -1 be removed like you did in other patches?
>
>
> int __net_init smc_sysctl_net_init(struct net *net)
> {
> struct ctl_table *table;
>
> table = smc_table;
> if (!net_eq(net, &init_net)) {
> int i;
>
> table = kmemdup(table, sizeof(smc_table), GFP_KERNEL);
> if (!table)
> goto err_alloc;
>
> for (i = 0; i < ARRAY_SIZE(smc_table) - 1; i++)
This is a very good catch !!!! Thx a lot!! I'll put this into my V6.

> table[i].data += (void *)net - (void *)&init_net;
> }
>
> net->smc.smc_hdr = register_net_sysctl_sz(net, "net/smc", table,
> ARRAY_SIZE(smc_table));
> [...]
>
> --
> Sabrina
>

--

Joel Granados
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2024-04-29 11:10    [W:0.114 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site