Patchwork [01/24] sysctl: net: call unregister_net_sysctl_table where needed

login
register
mail settings
Submitter Lucian Adrian Grijincu
Date April 2, 2011, 2:53 a.m.
Message ID <05ae3c2fdd2db1f6a2fd3cd900164667e615f4f8.1301711868.git.lucian.grijincu@gmail.com>
Download mbox | patch
Permalink /patch/89415/
State Deferred
Delegated to: David Miller
Headers show

Comments

Lucian Adrian Grijincu - April 2, 2011, 2:53 a.m.
ctl_table_headers registered with register_net_sysctl_table should
have been unregistered with the equivalent unregister_net_sysctl_table

Signed-off-by: Lucian Adrian Grijincu <lucian.grijincu@gmail.com>
---
 net/ipv4/devinet.c  |    2 +-
 net/ipv6/addrconf.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
David Miller - April 6, 2011, 7:52 p.m.
From: Lucian Adrian Grijincu <lucian.grijincu@gmail.com>
Date: Sat,  2 Apr 2011 04:53:15 +0200

> ctl_table_headers registered with register_net_sysctl_table should
> have been unregistered with the equivalent unregister_net_sysctl_table
> 
> Signed-off-by: Lucian Adrian Grijincu <lucian.grijincu@gmail.com>

Oops, hmmm...  Can this actually cause any real problems currently?

If so I'd like to toss this specific patch into net-2.6

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Lucian Adrian Grijincu - April 6, 2011, 8:04 p.m.
On Wed, Apr 6, 2011 at 9:52 PM, David Miller <davem@davemloft.net> wrote:
> Oops, hmmm...  Can this actually cause any real problems currently?
>
> If so I'd like to toss this specific patch into net-2.6


Nope:

void unregister_net_sysctl_table(struct ctl_table_header *header)
{
        unregister_sysctl_table(header);
}
EXPORT_SYMBOL_GPL(unregister_net_sysctl_table);

But I thought that in the future, if something special needs to be
done for unregister_net_sysctl_table, it would be better to have these
consistent. I'll do a check on all the tree to see if there are other
cases.

Another approach would be to remove unregister_net_sysctl_table, as it
does nothing different of unregister_sysctl_table and let our future
selves deal with the problem.

Can you tell me what you'd like?
David Miller - April 6, 2011, 8:06 p.m.
From: Lucian Adrian Grijincu <lucian.grijincu@gmail.com>
Date: Wed, 6 Apr 2011 22:04:53 +0200

> On Wed, Apr 6, 2011 at 9:52 PM, David Miller <davem@davemloft.net> wrote:
>> Oops, hmmm...  Can this actually cause any real problems currently?
>>
>> If so I'd like to toss this specific patch into net-2.6
> 
> 
> Nope:
> 
> void unregister_net_sysctl_table(struct ctl_table_header *header)
> {
>         unregister_sysctl_table(header);
> }
> EXPORT_SYMBOL_GPL(unregister_net_sysctl_table);

Ok, that's good.

> But I thought that in the future, if something special needs to be
> done for unregister_net_sysctl_table, it would be better to have these
> consistent. I'll do a check on all the tree to see if there are other
> cases.
> 
> Another approach would be to remove unregister_net_sysctl_table, as it
> does nothing different of unregister_sysctl_table and let our future
> selves deal with the problem.
> 
> Can you tell me what you'd like?

I think the thing to do is to keep this patch as it is, and only apply
it along with this cookie patch series, for -next.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index 5345b0b..cd9ca08 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -1680,7 +1680,7 @@  static void __devinet_sysctl_unregister(struct ipv4_devconf *cnf)
 		return;
 
 	cnf->sysctl = NULL;
-	unregister_sysctl_table(t->sysctl_header);
+	unregister_net_sysctl_table(t->sysctl_header);
 	kfree(t->dev_name);
 	kfree(t);
 }
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 3daaf3c..b1654a4 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -4537,7 +4537,7 @@  static void __addrconf_sysctl_unregister(struct ipv6_devconf *p)
 
 	t = p->sysctl;
 	p->sysctl = NULL;
-	unregister_sysctl_table(t->sysctl_header);
+	unregister_net_sysctl_table(t->sysctl_header);
 	kfree(t->dev_name);
 	kfree(t);
 }